diff --git a/KafkaConsumer/.classpath b/KafkaConsumer/.classpath deleted file mode 100644 index a5d95095..00000000 --- a/KafkaConsumer/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/KafkaConsumer/.project b/KafkaConsumer/.project deleted file mode 100644 index 40442cb7..00000000 --- a/KafkaConsumer/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - KafkaConsumer - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - org.springframework.ide.eclipse.boot.validation.springbootbuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - - diff --git a/KafkaConsumer/.settings/org.eclipse.core.resources.prefs b/KafkaConsumer/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c02..00000000 --- a/KafkaConsumer/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/KafkaConsumer/.settings/org.eclipse.jdt.core.prefs b/KafkaConsumer/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 71df5229..00000000 --- a/KafkaConsumer/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,9 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.methodParameters=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/KafkaConsumer/.settings/org.eclipse.wst.common.project.facet.core.xml b/KafkaConsumer/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index d8582952..00000000 --- a/KafkaConsumer/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/KafkaConsumer/.settings/org.springframework.ide.eclipse.prefs b/KafkaConsumer/.settings/org.springframework.ide.eclipse.prefs deleted file mode 100644 index a12794d6..00000000 --- a/KafkaConsumer/.settings/org.springframework.ide.eclipse.prefs +++ /dev/null @@ -1,2 +0,0 @@ -boot.validation.initialized=true -eclipse.preferences.version=1 diff --git a/KafkaConsumer/target/classes/META-INF/MANIFEST.MF b/KafkaConsumer/target/classes/META-INF/MANIFEST.MF deleted file mode 100644 index b48f7fc0..00000000 --- a/KafkaConsumer/target/classes/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: KafkaConsumer -Implementation-Version: 0.0.1-SNAPSHOT -Build-Jdk-Spec: 1.8 -Created-By: Maven Integration for Eclipse -Main-Class: com.nsa.app.KafkaConsumerApplication - diff --git a/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.properties b/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.properties deleted file mode 100644 index 7939b8b2..00000000 --- a/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.properties +++ /dev/null @@ -1,7 +0,0 @@ -#Generated by Maven Integration for Eclipse -#Thu Feb 13 21:23:31 EST 2020 -version=0.0.1-SNAPSHOT -groupId=com.nsa -m2e.projectName=KafkaConsumer -m2e.projectLocation=/home/shivali/Documents/DevelopmentBranch/NSA/KafkaConsumer -artifactId=KafkaConsumer diff --git a/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.xml b/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.xml deleted file mode 100644 index eda278b4..00000000 --- a/KafkaConsumer/target/classes/META-INF/maven/com.nsa/KafkaConsumer/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.4.RELEASE - - - com.nsa - KafkaConsumer - 0.0.1-SNAPSHOT - KafkaConsumer - Demo project for Spring Boot - - - 1.8 - com.nsa.app.KafkaConsumerApplication - - - - - org.springframework.boot - spring-boot-starter-web - - - com.google.code.gson - gson - 2.7 - - - org.springframework.kafka - spring-kafka - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.apache.tomcat - jasper - 6.0.32 - - - - mysql - mysql-connector-java - runtime - - - org.codehaus.jettison - jettison - 1.2 - - - com.google.code.gson - gson - 2.8.5 - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - org.springframework.kafka - spring-kafka-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/KafkaConsumer/target/classes/application.properties b/KafkaConsumer/target/classes/application.properties deleted file mode 100644 index 1389bb22..00000000 --- a/KafkaConsumer/target/classes/application.properties +++ /dev/null @@ -1,7 +0,0 @@ -server.port=8082 -spring.datasource.url= jdbc:mysql://localhost:3306/newdb -spring.datasource.username=root -spring.jpa.hibernate.ddl-auto=update -spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialet= org.hibernate.dialect.MySQL5Dialect \ No newline at end of file diff --git a/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumer.class b/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumer.class deleted file mode 100644 index 5875f4df..00000000 Binary files a/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumer.class and /dev/null differ diff --git a/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumerApplication.class b/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumerApplication.class deleted file mode 100644 index d7cbb8f3..00000000 Binary files a/KafkaConsumer/target/classes/com/nsa/app/KafkaConsumerApplication.class and /dev/null differ diff --git a/KafkaConsumer/target/classes/com/nsa/app/configuration/KafkaConfiguration.class b/KafkaConsumer/target/classes/com/nsa/app/configuration/KafkaConfiguration.class deleted file mode 100644 index 136d685c..00000000 Binary files a/KafkaConsumer/target/classes/com/nsa/app/configuration/KafkaConfiguration.class and /dev/null differ diff --git a/KafkaConsumer/target/classes/com/nsa/app/model/User.class b/KafkaConsumer/target/classes/com/nsa/app/model/User.class deleted file mode 100644 index e28245fc..00000000 Binary files a/KafkaConsumer/target/classes/com/nsa/app/model/User.class and /dev/null differ diff --git a/KafkaConsumer/target/classes/com/nsa/app/repository/UserRepository.class b/KafkaConsumer/target/classes/com/nsa/app/repository/UserRepository.class deleted file mode 100644 index 9d8aa542..00000000 Binary files a/KafkaConsumer/target/classes/com/nsa/app/repository/UserRepository.class and /dev/null differ diff --git a/KafkaConsumer/target/test-classes/com/nsa/app/KafkaConsumerApplicationTests.class b/KafkaConsumer/target/test-classes/com/nsa/app/KafkaConsumerApplicationTests.class deleted file mode 100644 index 3e62c592..00000000 Binary files a/KafkaConsumer/target/test-classes/com/nsa/app/KafkaConsumerApplicationTests.class and /dev/null differ diff --git a/api_gateway/Dockerfile b/api_gateway/Dockerfile new file mode 100644 index 00000000..01a61e49 --- /dev/null +++ b/api_gateway/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:13-jdk + +ADD api_gateway.jar / + +CMD [ "java", "-jar", "./api_gateway.jar" ] \ No newline at end of file diff --git a/KafkaConsumer/.gitignore b/api_gateway/KafkaProducer/.gitignore similarity index 100% rename from KafkaConsumer/.gitignore rename to api_gateway/KafkaProducer/.gitignore diff --git a/KafkaConsumer/.mvn/wrapper/MavenWrapperDownloader.java b/api_gateway/KafkaProducer/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from KafkaConsumer/.mvn/wrapper/MavenWrapperDownloader.java rename to api_gateway/KafkaProducer/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/KafkaConsumer/.mvn/wrapper/maven-wrapper.jar b/api_gateway/KafkaProducer/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from KafkaConsumer/.mvn/wrapper/maven-wrapper.jar rename to api_gateway/KafkaProducer/.mvn/wrapper/maven-wrapper.jar diff --git a/KafkaConsumer/.mvn/wrapper/maven-wrapper.properties b/api_gateway/KafkaProducer/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from KafkaConsumer/.mvn/wrapper/maven-wrapper.properties rename to api_gateway/KafkaProducer/.mvn/wrapper/maven-wrapper.properties diff --git a/api_gateway/KafkaProducer/Dockerfile b/api_gateway/KafkaProducer/Dockerfile new file mode 100644 index 00000000..bea57311 --- /dev/null +++ b/api_gateway/KafkaProducer/Dockerfile @@ -0,0 +1,27 @@ +FROM openjdk:13-jdk + +ARG MAVEN_VERSION=3.6.3 +ARG USER_HOME_DIR="/root" +ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 +ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries + +RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ + && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ + && echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ + && rm -f /tmp/apache-maven.tar.gz \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn + +ENV MAVEN_HOME /usr/share/maven +ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" + +COPY mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh +COPY settings-docker.xml /usr/share/maven/ref/ + +# ADD KafkaProducer / + +# RUN cd /KafkaProducer + +ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"] + +CMD ["mvn"] \ No newline at end of file diff --git a/api_gateway/KafkaProducer/api_gateway.jar b/api_gateway/KafkaProducer/api_gateway.jar new file mode 100644 index 00000000..fb32dbaf Binary files /dev/null and b/api_gateway/KafkaProducer/api_gateway.jar differ diff --git a/KafkaConsumer/mvnw b/api_gateway/KafkaProducer/mvnw similarity index 100% rename from KafkaConsumer/mvnw rename to api_gateway/KafkaProducer/mvnw diff --git a/KafkaConsumer/mvnw.cmd b/api_gateway/KafkaProducer/mvnw.cmd similarity index 100% rename from KafkaConsumer/mvnw.cmd rename to api_gateway/KafkaProducer/mvnw.cmd diff --git a/KafkaProducer/pom.xml b/api_gateway/KafkaProducer/pom.xml similarity index 99% rename from KafkaProducer/pom.xml rename to api_gateway/KafkaProducer/pom.xml index 3d61eb2b..a8d50e65 100644 --- a/KafkaProducer/pom.xml +++ b/api_gateway/KafkaProducer/pom.xml @@ -70,7 +70,7 @@ org.springframework.boot spring-boot-maven-plugin - + diff --git a/KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java similarity index 94% rename from KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java index 6251b3c3..046bf059 100644 --- a/KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java +++ b/api_gateway/KafkaProducer/src/main/java/com/example/demo/ApiGatewayResource.java @@ -43,7 +43,7 @@ public class ApiGatewayResource { @Autowired KafkaTemplate kafkaTemplateSession; - @CrossOrigin(origins = "http://localhost:3000", maxAge = 3600) + @CrossOrigin(origins = "http://ui:3000", maxAge = 3600) @RequestMapping(value="/login", method = RequestMethod.POST, consumes = "application/json") public String login(@RequestBody String message) throws InterruptedException { //String message=user.getFirstName(); @@ -60,7 +60,7 @@ public String login(@RequestBody String message) throws InterruptedException { return ack; } - @CrossOrigin(origins = "http://localhost:3000", maxAge = 3600) + @CrossOrigin(origins = "http://ui:3000", maxAge = 3600) @RequestMapping(value="/register", method = RequestMethod.POST, consumes = "application/json") public String register(@RequestBody String message) throws InterruptedException { kafkaTemplate.send(TOPIC_REGISTER_MESSAGE,message); @@ -77,7 +77,7 @@ public String register(@RequestBody String message) throws InterruptedException - @CrossOrigin(origins = "http://localhost:3000", maxAge = 3600) + @CrossOrigin(origins = "http://ui:3000", maxAge = 3600) @RequestMapping(value="/dataretrieval", method = RequestMethod.POST, consumes = "application/json") public String dataRetrival(@RequestBody String message) throws InterruptedException { kafkaTemplate.send(TOPIC_DATARETRIVE_MESSAGE,message); @@ -94,7 +94,7 @@ public String dataRetrival(@RequestBody String message) throws InterruptedExcept } - @CrossOrigin(origins = "http://localhost:3000", maxAge = 3600) + @CrossOrigin(origins = "http://ui:3000", maxAge = 3600) @RequestMapping(value = "/sessionmgmt"/* , method = RequestMethod.POST, consumes = "application/json" */) public String sessionManagement(/* @RequestBody String sessionDetails */) throws InterruptedException, URISyntaxException, JSONException, ExecutionException { diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaListenerDataRetrieval.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerDataRetrieval.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/KafkaListenerDataRetrieval.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerDataRetrieval.java diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaListenerLoginFeeback.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerLoginFeeback.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/KafkaListenerLoginFeeback.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerLoginFeeback.java diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaListenerRegisterFeeback.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerRegisterFeeback.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/KafkaListenerRegisterFeeback.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerRegisterFeeback.java diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaListenerSessionFeedback.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerSessionFeedback.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/KafkaListenerSessionFeedback.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaListenerSessionFeedback.java diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaProducerApplication.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaProducerApplication.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/KafkaProducerApplication.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaProducerApplication.java diff --git a/KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java similarity index 94% rename from KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java index 9a824c6e..78b587c4 100644 --- a/KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java +++ b/api_gateway/KafkaProducer/src/main/java/com/example/demo/KafkaProducerConfiguration.java @@ -29,7 +29,7 @@ public class KafkaProducerConfiguration { public ProducerFactory producerFactory(){ Map config= new HashMap<>(); - config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"127.0.0.1:9092" ); + config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"kafka:9092" ); config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,JsonSerializer.class ); config.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,JsonSerializer.class ); @@ -54,7 +54,7 @@ public KafkaTemplate kafkaTemplate(){ public ConsumerFactory consumerFactory(){ Map config =new HashMap<>(); - config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092"); + config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka:9092"); config.put(ConsumerConfig.GROUP_ID_CONFIG, "group_id"); config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); diff --git a/KafkaProducer/src/main/java/com/example/demo/SessionRequestTemplate.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/SessionRequestTemplate.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/SessionRequestTemplate.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/SessionRequestTemplate.java diff --git a/KafkaProducer/src/main/java/com/example/demo/User.java b/api_gateway/KafkaProducer/src/main/java/com/example/demo/User.java similarity index 100% rename from KafkaProducer/src/main/java/com/example/demo/User.java rename to api_gateway/KafkaProducer/src/main/java/com/example/demo/User.java diff --git a/KafkaProducer/src/main/resources/application.properties b/api_gateway/KafkaProducer/src/main/resources/application.properties similarity index 100% rename from KafkaProducer/src/main/resources/application.properties rename to api_gateway/KafkaProducer/src/main/resources/application.properties diff --git a/KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java b/api_gateway/KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java similarity index 82% rename from KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java rename to api_gateway/KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java index 21f473ea..ae6f79d8 100644 --- a/KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java +++ b/api_gateway/KafkaProducer/src/test/java/com/example/demo/KafkaProducerApplicationTests.java @@ -6,8 +6,8 @@ @SpringBootTest class KafkaProducerApplicationTests { - @Test - void contextLoads() { - } +// @Test +// void contextLoads() { +// } } diff --git a/api_gateway.jar b/api_gateway/api_gateway.jar similarity index 99% rename from api_gateway.jar rename to api_gateway/api_gateway.jar index 2ae643e0..3a114944 100644 Binary files a/api_gateway.jar and b/api_gateway/api_gateway.jar differ diff --git a/data-retrieval/Dockerfile b/data-retrieval/Dockerfile index 54c8263a..dfee821d 100644 --- a/data-retrieval/Dockerfile +++ b/data-retrieval/Dockerfile @@ -1,9 +1,8 @@ FROM python:3-onbuild ADD dataretrieval.py / -RUN pip install --upgrade pip +RUN pip3 install --upgrade pip ADD requirements.txt / RUN pip3 install -r requirements.txt -RUN echo "RUN DONE" CMD [ "python3", "./dataretrieval.py" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f8aa4fd0..674a272a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,23 +1,130 @@ -version: '2' - +version: '3' services: zookeeper: image: wurstmeister/zookeeper ports: - - "2181:2181" + - 2181:2181 + hostname: zookeeper + networks: + - nsa kafka: - image: wurstmeister/kafka:2.12-2.4.0 - depends_on: - - zookeeper + image: wurstmeister/kafka + command: [start-kafka.sh] + expose: + - 9092 ports: - "9092:9092" + networks: + - nsa environment: - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 KAFKA_CREATE_TOPICS: " test:1:1, dataretrieval-postprocess:1:1, postprocess-dataretrieval:1:1, - " + LoginSuccessMessage:1:1, + RegisterSuccessMessage:1:1, + KafkaLoginMessage:1:1, + KafkaRegisterMessage:1:1, + messagehandler-dataretrieval:1:1, + messagehandler-sessionmgmt:1:1, + sessionmgmt-messagehandler:1:1, + post_process:1:1, + login-sessionmgmt:1:1, + register-sessionmgmt:1:1, + dataretrieval-sessionmgmt:1:1, + postprocess-sessionmgmt:1:1, + sessionhistory-ui:1:1, + ui-sessionhistory:1:1, + " + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_PORT: 9092 + KAFKA_ADVERTISED_LISTENER: PLAINTEXT://kafka:9092 KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 \ No newline at end of file + KAFKA_ADVERTISED_HOST_NAME: kafka + # expose: + # - "9092" + healthcheck: + test: ["CMD", "/opt/kafka/bin/kafka-topics.sh", "--list", "--zookeeper", "zookeeper:2181"] + interval: 30s + timeout: 10s + retries: 3 + # start_period: 15s + + volumes: + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - zookeeper + + + # data-retrieval: + # build: './data-retrieval' + # networks: + # - nsa + # depends_on: + # - kafka + # - zookeeper + # restart: unless-stopped + + api_gateway: + build: './api_gateway' + ports: + - 8081:8081 + networks: + - nsa + depends_on: + - kafka + + user_management: + build: './user_management' + ports: + - 8082:8082 + networks: + - nsa + depends_on: + - kafka + - adminer + + db: + image: mysql:5.7 + ports: + - 3306:3306 + networks: + - nsa + volumes: + - db_data:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: root_password + MYSQL_DATABASE: db + MYSQL_USER: user + MYSQL_PASSWORD: password + + adminer: + image: adminer + restart: always + expose: + - 8083 + ports: + - 8083:8083 + networks: + - nsa + depends_on: + - db + + + # postprocessing: + # build: './postprocessing' + # networks: + # - nsa + # depends_on: + # - kafka + # - zookeeper + # - data-retrieval + # restart: unless-stopped + +networks: + nsa: + +volumes: + db_data: {} \ No newline at end of file diff --git a/user_management/Dockerfile b/user_management/Dockerfile new file mode 100644 index 00000000..d1f21dbf --- /dev/null +++ b/user_management/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:13-jdk + +ADD user_management.jar / + +CMD [ "java", "-jar", "./user_management.jar" ] \ No newline at end of file diff --git a/KafkaProducer/.gitignore b/user_management/KafkaConsumer/.gitignore similarity index 100% rename from KafkaProducer/.gitignore rename to user_management/KafkaConsumer/.gitignore diff --git a/KafkaProducer/.mvn/wrapper/MavenWrapperDownloader.java b/user_management/KafkaConsumer/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from KafkaProducer/.mvn/wrapper/MavenWrapperDownloader.java rename to user_management/KafkaConsumer/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/KafkaProducer/.mvn/wrapper/maven-wrapper.jar b/user_management/KafkaConsumer/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from KafkaProducer/.mvn/wrapper/maven-wrapper.jar rename to user_management/KafkaConsumer/.mvn/wrapper/maven-wrapper.jar diff --git a/KafkaProducer/.mvn/wrapper/maven-wrapper.properties b/user_management/KafkaConsumer/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from KafkaProducer/.mvn/wrapper/maven-wrapper.properties rename to user_management/KafkaConsumer/.mvn/wrapper/maven-wrapper.properties diff --git a/KafkaProducer/mvnw b/user_management/KafkaConsumer/mvnw similarity index 100% rename from KafkaProducer/mvnw rename to user_management/KafkaConsumer/mvnw diff --git a/KafkaProducer/mvnw.cmd b/user_management/KafkaConsumer/mvnw.cmd similarity index 100% rename from KafkaProducer/mvnw.cmd rename to user_management/KafkaConsumer/mvnw.cmd diff --git a/KafkaConsumer/pom.xml b/user_management/KafkaConsumer/pom.xml similarity index 100% rename from KafkaConsumer/pom.xml rename to user_management/KafkaConsumer/pom.xml diff --git a/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumer.java b/user_management/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumer.java similarity index 100% rename from KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumer.java rename to user_management/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumer.java diff --git a/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumerApplication.java b/user_management/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumerApplication.java similarity index 100% rename from KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumerApplication.java rename to user_management/KafkaConsumer/src/main/java/com/nsa/app/KafkaConsumerApplication.java diff --git a/KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java b/user_management/KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java similarity index 93% rename from KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java rename to user_management/KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java index f1381a9b..162353c2 100644 --- a/KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java +++ b/user_management/KafkaConsumer/src/main/java/com/nsa/app/configuration/KafkaConfiguration.java @@ -26,7 +26,7 @@ public class KafkaConfiguration { public ConsumerFactory consumerFactory(){ Map config =new HashMap<>(); - config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092"); + config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka:9092"); config.put(ConsumerConfig.GROUP_ID_CONFIG, "group_id"); config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); @@ -51,7 +51,7 @@ public ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory() { public ProducerFactory producerFactory(){ Map config= new HashMap<>(); - config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"127.0.0.1:9092" ); + config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"kafka:9092" ); config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,StringSerializer.class ); config.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,JsonSerializer.class ); diff --git a/KafkaConsumer/src/main/java/com/nsa/app/model/User.java b/user_management/KafkaConsumer/src/main/java/com/nsa/app/model/User.java similarity index 100% rename from KafkaConsumer/src/main/java/com/nsa/app/model/User.java rename to user_management/KafkaConsumer/src/main/java/com/nsa/app/model/User.java diff --git a/KafkaConsumer/src/main/java/com/nsa/app/repository/UserRepository.java b/user_management/KafkaConsumer/src/main/java/com/nsa/app/repository/UserRepository.java similarity index 100% rename from KafkaConsumer/src/main/java/com/nsa/app/repository/UserRepository.java rename to user_management/KafkaConsumer/src/main/java/com/nsa/app/repository/UserRepository.java diff --git a/KafkaConsumer/src/main/resources/application.properties b/user_management/KafkaConsumer/src/main/resources/application.properties similarity index 69% rename from KafkaConsumer/src/main/resources/application.properties rename to user_management/KafkaConsumer/src/main/resources/application.properties index 1389bb22..6a4ad062 100644 --- a/KafkaConsumer/src/main/resources/application.properties +++ b/user_management/KafkaConsumer/src/main/resources/application.properties @@ -1,6 +1,7 @@ server.port=8082 -spring.datasource.url= jdbc:mysql://localhost:3306/newdb -spring.datasource.username=root +spring.datasource.url= jdbc:mysql://db:3306/db +spring.datasource.username=user +spring.datasource.password=password spring.jpa.hibernate.ddl-auto=update spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy diff --git a/KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java b/user_management/KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java similarity index 81% rename from KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java rename to user_management/KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java index 9b246bda..afa49668 100644 --- a/KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java +++ b/user_management/KafkaConsumer/src/test/java/com/nsa/app/KafkaConsumerApplicationTests.java @@ -6,8 +6,8 @@ @SpringBootTest class KafkaConsumerApplicationTests { - @Test - void contextLoads() { - } +// @Test +// void contextLoads() { +// } } diff --git a/user_management.jar b/user_management/user_management.jar similarity index 99% rename from user_management.jar rename to user_management/user_management.jar index 676e65c9..869221a3 100644 Binary files a/user_management.jar and b/user_management/user_management.jar differ diff --git a/usermanagement/.gitignore b/usermanagement/.gitignore deleted file mode 100644 index a2a3040a..00000000 --- a/usermanagement/.gitignore +++ /dev/null @@ -1,31 +0,0 @@ -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/ diff --git a/usermanagement/.mvn/wrapper/MavenWrapperDownloader.java b/usermanagement/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100644 index e76d1f32..00000000 --- a/usermanagement/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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(); - } - -} diff --git a/usermanagement/.mvn/wrapper/maven-wrapper.jar b/usermanagement/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 2cc7d4a5..00000000 Binary files a/usermanagement/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/usermanagement/.mvn/wrapper/maven-wrapper.properties b/usermanagement/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 642d572c..00000000 --- a/usermanagement/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/usermanagement/mvnw b/usermanagement/mvnw deleted file mode 100644 index a16b5431..00000000 --- a/usermanagement/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/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 "$@" diff --git a/usermanagement/mvnw.cmd b/usermanagement/mvnw.cmd deleted file mode 100644 index c8d43372..00000000 --- a/usermanagement/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@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% diff --git a/usermanagement/pom.xml b/usermanagement/pom.xml deleted file mode 100644 index 75500c46..00000000 --- a/usermanagement/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.4.RELEASE - - - com.nsa.webapp - LatestGRPCServer - 0.0.1-SNAPSHOT - LatestGRPCServer - Demo project for Spring Boot - - - 1.8 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - com.google.protobuf - protobuf-java - 3.6.1 - - - - org.apache.tomcat - tomcat-jasper - 9.0.14 - - - mysql - mysql-connector-java - - - - - io.grpc - grpc-netty-shaded - 1.15.1 - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-test - test - - - io.grpc - grpc-protobuf - 1.15.1 - - - io.grpc - grpc-stub - 1.15.1 - - - - - - clean generate-sources compile install - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - - - com.github.os72 - protoc-jar-maven-plugin - 3.6.0.1 - - - generate-sources - - run - - - direct - - - src/main/resources - - - - - java - src/main/java - - - grpc-java - io.grpc:protoc-gen-grpc-java:1.15.0 - src/main/java - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - - - - - diff --git a/usermanagement/src/main/java/com/nsa/webapp/LoginController.java b/usermanagement/src/main/java/com/nsa/webapp/LoginController.java deleted file mode 100644 index dba7768a..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/LoginController.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.nsa.webapp; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class LoginController { - - - @RequestMapping("/") - public String home() { - return "home.jsp"; - } -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/LoginService.java b/usermanagement/src/main/java/com/nsa/webapp/LoginService.java deleted file mode 100644 index 13be2ae8..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/LoginService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.nsa.webapp; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -@Service -public interface LoginService extends UserDetailsService{ - -// private UserRepository repo; -// -// -// @Override -// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { -// -// User user= repo.findByUsername(username); -// if(user==null) { -// throw new UsernameNotFoundException("USer 404"); -// } -// return new LoginServiceImpl(user); -// } - -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/LoginServiceImpl.java b/usermanagement/src/main/java/com/nsa/webapp/LoginServiceImpl.java deleted file mode 100644 index 74534aca..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/LoginServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.nsa.webapp; -import java.util.Collection; -import java.util.Collections; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; - -public class LoginServiceImpl implements UserDetails{ - - private User user; - - public LoginServiceImpl(User user) { - super(); - this.user = user; - } - - @Override - public Collection getAuthorities() { - // TODO Auto-generated method stub - return Collections.singleton(new SimpleGrantedAuthority("USER")); - } - - @Override - public String getPassword() { - // TODO Auto-generated method stub - return user.getPassword(); - } - - @Override - public String getUsername() { - // TODO Auto-generated method stub - return user.getUsername(); - } - - @Override - public boolean isAccountNonExpired() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isAccountNonLocked() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isCredentialsNonExpired() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isEnabled() { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/SecurityConfiguration.java b/usermanagement/src/main/java/com/nsa/webapp/SecurityConfiguration.java deleted file mode 100644 index b61fd039..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/SecurityConfiguration.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.nsa.webapp; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.authentication.AuthenticationProvider; -import org.springframework.security.authentication.dao.DaoAuthenticationProvider; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.NoOpPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.provisioning.InMemoryUserDetailsManager; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; -import org.springframework.util.AntPathMatcher; - -@Configuration -@EnableWebSecurity -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - // @Bean - // @Override - // protected UserDetailsService userDetailsService() { - // - // List users= new ArrayList<>(); - // users.add(User.withDefaultPasswordEncoder().username("Shivali").password("1234").roles("USER").build()); - // - // return new InMemoryUserDetailsManager(users); - // } - // - @Autowired - private UserDetailsService userDetailsService; - - - - @Bean - public AuthenticationProvider authProvider() { - DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); - provider.setUserDetailsService(userDetailsService); - provider.setPasswordEncoder(new BCryptPasswordEncoder()); - return provider; - } - - - -// @Override -// protected void configure(HttpSecurity http) throws Exception { -// http.csrf().disable() -// .formLogin() -// .loginPage("/login").permitAll() -// .and() -// .logout().invalidateHttpSession(true) -// .clearAuthentication(true) -// .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) -// .logoutSuccessUrl("/log-success").permitAll(); -// -// -// } - - -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/User.java b/usermanagement/src/main/java/com/nsa/webapp/User.java deleted file mode 100644 index 022ad795..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/User.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.nsa.webapp; -import javax.persistence.Entity; -import javax.persistence.Id; - -@Entity -public class User { - - @Id - public long getId() { - return id; - } - public void setId(long id) { - this.id = id; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - private long id; - private String username; - private String password; -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/UserRepository.java b/usermanagement/src/main/java/com/nsa/webapp/UserRepository.java deleted file mode 100644 index bcdfc42d..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/UserRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.nsa.webapp; -import org.springframework.data.jpa.repository.JpaRepository; - - -public interface UserRepository extends JpaRepository{ - - User findByUsername(String username); -} diff --git a/usermanagement/src/main/java/com/nsa/webapp/Usermanagement.java b/usermanagement/src/main/java/com/nsa/webapp/Usermanagement.java deleted file mode 100644 index 41ed5499..00000000 --- a/usermanagement/src/main/java/com/nsa/webapp/Usermanagement.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.nsa.webapp; - -import java.io.IOException; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -import io.grpc.Server; -import io.grpc.ServerBuilder; -import user.UserService; - -@SpringBootApplication -public class Usermanagement { - - public static void main(String[] args) throws IOException, InterruptedException { - - Server server = ServerBuilder.forPort(9090).addService(new UserService()).build(); - server.start(); - - System.out.println("Server started at:"+server.getPort()); - - server.awaitTermination(); - SpringApplication.run(Usermanagement.class, args); - } - -} diff --git a/usermanagement/src/main/java/proto_files/User.java b/usermanagement/src/main/java/proto_files/User.java deleted file mode 100644 index 7ab2feee..00000000 --- a/usermanagement/src/main/java/proto_files/User.java +++ /dev/null @@ -1,1794 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: user.proto - -package proto_files; - -public final class User { - private User() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - public interface LoginRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:LoginRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string username = 1; - */ - java.lang.String getUsername(); - /** - * string username = 1; - */ - com.google.protobuf.ByteString - getUsernameBytes(); - - /** - * string password = 2; - */ - java.lang.String getPassword(); - /** - * string password = 2; - */ - com.google.protobuf.ByteString - getPasswordBytes(); - } - /** - * Protobuf type {@code LoginRequest} - */ - public static final class LoginRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:LoginRequest) - LoginRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use LoginRequest.newBuilder() to construct. - private LoginRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LoginRequest() { - username_ = ""; - password_ = ""; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LoginRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_LoginRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_LoginRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.LoginRequest.class, proto_files.User.LoginRequest.Builder.class); - } - - public static final int USERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object username_; - /** - * string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - * string username = 1; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private volatile java.lang.Object password_; - /** - * string password = 2; - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - * string password = 2; - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof proto_files.User.LoginRequest)) { - return super.equals(obj); - } - proto_files.User.LoginRequest other = (proto_files.User.LoginRequest) obj; - - boolean result = true; - result = result && getUsername() - .equals(other.getUsername()); - result = result && getPassword() - .equals(other.getPassword()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static proto_files.User.LoginRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.LoginRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.LoginRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(proto_files.User.LoginRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code LoginRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:LoginRequest) - proto_files.User.LoginRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_LoginRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_LoginRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.LoginRequest.class, proto_files.User.LoginRequest.Builder.class); - } - - // Construct using proto_files.User.LoginRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - username_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return proto_files.User.internal_static_LoginRequest_descriptor; - } - - @java.lang.Override - public proto_files.User.LoginRequest getDefaultInstanceForType() { - return proto_files.User.LoginRequest.getDefaultInstance(); - } - - @java.lang.Override - public proto_files.User.LoginRequest build() { - proto_files.User.LoginRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public proto_files.User.LoginRequest buildPartial() { - proto_files.User.LoginRequest result = new proto_files.User.LoginRequest(this); - result.username_ = username_; - result.password_ = password_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof proto_files.User.LoginRequest) { - return mergeFrom((proto_files.User.LoginRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(proto_files.User.LoginRequest other) { - if (other == proto_files.User.LoginRequest.getDefaultInstance()) return this; - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - proto_files.User.LoginRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (proto_files.User.LoginRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object username_ = ""; - /** - * string username = 1; - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string username = 1; - */ - public com.google.protobuf.ByteString - getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string username = 1; - */ - public Builder setUsername( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - * string username = 1; - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * string username = 1; - */ - public Builder setUsernameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - * string password = 2; - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string password = 2; - */ - public com.google.protobuf.ByteString - getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string password = 2; - */ - public Builder setPassword( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - * string password = 2; - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - * string password = 2; - */ - public Builder setPasswordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:LoginRequest) - } - - // @@protoc_insertion_point(class_scope:LoginRequest) - private static final proto_files.User.LoginRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new proto_files.User.LoginRequest(); - } - - public static proto_files.User.LoginRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LoginRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LoginRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public proto_files.User.LoginRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface LoginRequestAPIResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:LoginRequestAPIResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * string responsemessage = 1; - */ - java.lang.String getResponsemessage(); - /** - * string responsemessage = 1; - */ - com.google.protobuf.ByteString - getResponsemessageBytes(); - - /** - * int32 responseCode = 2; - */ - int getResponseCode(); - } - /** - * Protobuf type {@code LoginRequestAPIResponse} - */ - public static final class LoginRequestAPIResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:LoginRequestAPIResponse) - LoginRequestAPIResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use LoginRequestAPIResponse.newBuilder() to construct. - private LoginRequestAPIResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LoginRequestAPIResponse() { - responsemessage_ = ""; - responseCode_ = 0; - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LoginRequestAPIResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - responsemessage_ = s; - break; - } - case 16: { - - responseCode_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_LoginRequestAPIResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_LoginRequestAPIResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.LoginRequestAPIResponse.class, proto_files.User.LoginRequestAPIResponse.Builder.class); - } - - public static final int RESPONSEMESSAGE_FIELD_NUMBER = 1; - private volatile java.lang.Object responsemessage_; - /** - * string responsemessage = 1; - */ - public java.lang.String getResponsemessage() { - java.lang.Object ref = responsemessage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - responsemessage_ = s; - return s; - } - } - /** - * string responsemessage = 1; - */ - public com.google.protobuf.ByteString - getResponsemessageBytes() { - java.lang.Object ref = responsemessage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - responsemessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int RESPONSECODE_FIELD_NUMBER = 2; - private int responseCode_; - /** - * int32 responseCode = 2; - */ - public int getResponseCode() { - return responseCode_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getResponsemessageBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, responsemessage_); - } - if (responseCode_ != 0) { - output.writeInt32(2, responseCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getResponsemessageBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, responsemessage_); - } - if (responseCode_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, responseCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof proto_files.User.LoginRequestAPIResponse)) { - return super.equals(obj); - } - proto_files.User.LoginRequestAPIResponse other = (proto_files.User.LoginRequestAPIResponse) obj; - - boolean result = true; - result = result && getResponsemessage() - .equals(other.getResponsemessage()); - result = result && (getResponseCode() - == other.getResponseCode()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESPONSEMESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getResponsemessage().hashCode(); - hash = (37 * hash) + RESPONSECODE_FIELD_NUMBER; - hash = (53 * hash) + getResponseCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static proto_files.User.LoginRequestAPIResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.LoginRequestAPIResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequestAPIResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.LoginRequestAPIResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(proto_files.User.LoginRequestAPIResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code LoginRequestAPIResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:LoginRequestAPIResponse) - proto_files.User.LoginRequestAPIResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_LoginRequestAPIResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_LoginRequestAPIResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.LoginRequestAPIResponse.class, proto_files.User.LoginRequestAPIResponse.Builder.class); - } - - // Construct using proto_files.User.LoginRequestAPIResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - responsemessage_ = ""; - - responseCode_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return proto_files.User.internal_static_LoginRequestAPIResponse_descriptor; - } - - @java.lang.Override - public proto_files.User.LoginRequestAPIResponse getDefaultInstanceForType() { - return proto_files.User.LoginRequestAPIResponse.getDefaultInstance(); - } - - @java.lang.Override - public proto_files.User.LoginRequestAPIResponse build() { - proto_files.User.LoginRequestAPIResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public proto_files.User.LoginRequestAPIResponse buildPartial() { - proto_files.User.LoginRequestAPIResponse result = new proto_files.User.LoginRequestAPIResponse(this); - result.responsemessage_ = responsemessage_; - result.responseCode_ = responseCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof proto_files.User.LoginRequestAPIResponse) { - return mergeFrom((proto_files.User.LoginRequestAPIResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(proto_files.User.LoginRequestAPIResponse other) { - if (other == proto_files.User.LoginRequestAPIResponse.getDefaultInstance()) return this; - if (!other.getResponsemessage().isEmpty()) { - responsemessage_ = other.responsemessage_; - onChanged(); - } - if (other.getResponseCode() != 0) { - setResponseCode(other.getResponseCode()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - proto_files.User.LoginRequestAPIResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (proto_files.User.LoginRequestAPIResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object responsemessage_ = ""; - /** - * string responsemessage = 1; - */ - public java.lang.String getResponsemessage() { - java.lang.Object ref = responsemessage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - responsemessage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string responsemessage = 1; - */ - public com.google.protobuf.ByteString - getResponsemessageBytes() { - java.lang.Object ref = responsemessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - responsemessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string responsemessage = 1; - */ - public Builder setResponsemessage( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - responsemessage_ = value; - onChanged(); - return this; - } - /** - * string responsemessage = 1; - */ - public Builder clearResponsemessage() { - - responsemessage_ = getDefaultInstance().getResponsemessage(); - onChanged(); - return this; - } - /** - * string responsemessage = 1; - */ - public Builder setResponsemessageBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - responsemessage_ = value; - onChanged(); - return this; - } - - private int responseCode_ ; - /** - * int32 responseCode = 2; - */ - public int getResponseCode() { - return responseCode_; - } - /** - * int32 responseCode = 2; - */ - public Builder setResponseCode(int value) { - - responseCode_ = value; - onChanged(); - return this; - } - /** - * int32 responseCode = 2; - */ - public Builder clearResponseCode() { - - responseCode_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:LoginRequestAPIResponse) - } - - // @@protoc_insertion_point(class_scope:LoginRequestAPIResponse) - private static final proto_files.User.LoginRequestAPIResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new proto_files.User.LoginRequestAPIResponse(); - } - - public static proto_files.User.LoginRequestAPIResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LoginRequestAPIResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LoginRequestAPIResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public proto_files.User.LoginRequestAPIResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface EmptyOrBuilder extends - // @@protoc_insertion_point(interface_extends:Empty) - com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code Empty} - */ - public static final class Empty extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Empty) - EmptyOrBuilder { - private static final long serialVersionUID = 0L; - // Use Empty.newBuilder() to construct. - private Empty(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Empty() { - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Empty( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_Empty_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.Empty.class, proto_files.User.Empty.Builder.class); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof proto_files.User.Empty)) { - return super.equals(obj); - } - proto_files.User.Empty other = (proto_files.User.Empty) obj; - - boolean result = true; - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static proto_files.User.Empty parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.Empty parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.Empty parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.Empty parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.Empty parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static proto_files.User.Empty parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static proto_files.User.Empty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.Empty parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.Empty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static proto_files.User.Empty parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static proto_files.User.Empty parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static proto_files.User.Empty parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(proto_files.User.Empty prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code Empty} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Empty) - proto_files.User.EmptyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return proto_files.User.internal_static_Empty_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return proto_files.User.internal_static_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - proto_files.User.Empty.class, proto_files.User.Empty.Builder.class); - } - - // Construct using proto_files.User.Empty.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return proto_files.User.internal_static_Empty_descriptor; - } - - @java.lang.Override - public proto_files.User.Empty getDefaultInstanceForType() { - return proto_files.User.Empty.getDefaultInstance(); - } - - @java.lang.Override - public proto_files.User.Empty build() { - proto_files.User.Empty result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public proto_files.User.Empty buildPartial() { - proto_files.User.Empty result = new proto_files.User.Empty(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof proto_files.User.Empty) { - return mergeFrom((proto_files.User.Empty)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(proto_files.User.Empty other) { - if (other == proto_files.User.Empty.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - proto_files.User.Empty parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (proto_files.User.Empty) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:Empty) - } - - // @@protoc_insertion_point(class_scope:Empty) - private static final proto_files.User.Empty DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new proto_files.User.Empty(); - } - - public static proto_files.User.Empty getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Empty parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Empty(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public proto_files.User.Empty getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_LoginRequest_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_LoginRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_LoginRequestAPIResponse_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_LoginRequestAPIResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Empty_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Empty_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\nuser.proto\"2\n\014LoginRequest\022\020\n\010username" + - "\030\001 \001(\t\022\020\n\010password\030\002 \001(\t\"H\n\027LoginRequest" + - "APIResponse\022\027\n\017responsemessage\030\001 \001(\t\022\024\n\014" + - "responseCode\030\002 \001(\005\"\007\n\005Empty2d\n\004user\0220\n\005l" + - "ogin\022\r.LoginRequest\032\030.LoginRequestAPIRes" + - "ponse\022*\n\006logout\022\006.Empty\032\030.LoginRequestAP" + - "IResponseB\r\n\013proto_filesb\006proto3" - }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); - internal_static_LoginRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_LoginRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_LoginRequest_descriptor, - new java.lang.String[] { "Username", "Password", }); - internal_static_LoginRequestAPIResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_LoginRequestAPIResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_LoginRequestAPIResponse_descriptor, - new java.lang.String[] { "Responsemessage", "ResponseCode", }); - internal_static_Empty_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_Empty_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Empty_descriptor, - new java.lang.String[] { }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/usermanagement/src/main/java/proto_files/userGrpc.java b/usermanagement/src/main/java/proto_files/userGrpc.java deleted file mode 100644 index 4d68668d..00000000 --- a/usermanagement/src/main/java/proto_files/userGrpc.java +++ /dev/null @@ -1,355 +0,0 @@ -package proto_files; - -import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; -import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.15.0)", - comments = "Source: user.proto") -public final class userGrpc { - - private userGrpc() {} - - public static final String SERVICE_NAME = "user"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getLoginMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "login", - requestType = proto_files.User.LoginRequest.class, - responseType = proto_files.User.LoginRequestAPIResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getLoginMethod() { - io.grpc.MethodDescriptor getLoginMethod; - if ((getLoginMethod = userGrpc.getLoginMethod) == null) { - synchronized (userGrpc.class) { - if ((getLoginMethod = userGrpc.getLoginMethod) == null) { - userGrpc.getLoginMethod = getLoginMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "user", "login")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - proto_files.User.LoginRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - proto_files.User.LoginRequestAPIResponse.getDefaultInstance())) - .setSchemaDescriptor(new userMethodDescriptorSupplier("login")) - .build(); - } - } - } - return getLoginMethod; - } - - private static volatile io.grpc.MethodDescriptor getLogoutMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "logout", - requestType = proto_files.User.Empty.class, - responseType = proto_files.User.LoginRequestAPIResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getLogoutMethod() { - io.grpc.MethodDescriptor getLogoutMethod; - if ((getLogoutMethod = userGrpc.getLogoutMethod) == null) { - synchronized (userGrpc.class) { - if ((getLogoutMethod = userGrpc.getLogoutMethod) == null) { - userGrpc.getLogoutMethod = getLogoutMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName( - "user", "logout")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - proto_files.User.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - proto_files.User.LoginRequestAPIResponse.getDefaultInstance())) - .setSchemaDescriptor(new userMethodDescriptorSupplier("logout")) - .build(); - } - } - } - return getLogoutMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static userStub newStub(io.grpc.Channel channel) { - return new userStub(channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static userBlockingStub newBlockingStub( - io.grpc.Channel channel) { - return new userBlockingStub(channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static userFutureStub newFutureStub( - io.grpc.Channel channel) { - return new userFutureStub(channel); - } - - /** - */ - public static abstract class userImplBase implements io.grpc.BindableService { - - /** - */ - public void login(proto_files.User.LoginRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getLoginMethod(), responseObserver); - } - - /** - */ - public void logout(proto_files.User.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getLogoutMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getLoginMethod(), - asyncUnaryCall( - new MethodHandlers< - proto_files.User.LoginRequest, - proto_files.User.LoginRequestAPIResponse>( - this, METHODID_LOGIN))) - .addMethod( - getLogoutMethod(), - asyncUnaryCall( - new MethodHandlers< - proto_files.User.Empty, - proto_files.User.LoginRequestAPIResponse>( - this, METHODID_LOGOUT))) - .build(); - } - } - - /** - */ - public static final class userStub extends io.grpc.stub.AbstractStub { - private userStub(io.grpc.Channel channel) { - super(channel); - } - - private userStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected userStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new userStub(channel, callOptions); - } - - /** - */ - public void login(proto_files.User.LoginRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getLoginMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void logout(proto_files.User.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getLogoutMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class userBlockingStub extends io.grpc.stub.AbstractStub { - private userBlockingStub(io.grpc.Channel channel) { - super(channel); - } - - private userBlockingStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected userBlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new userBlockingStub(channel, callOptions); - } - - /** - */ - public proto_files.User.LoginRequestAPIResponse login(proto_files.User.LoginRequest request) { - return blockingUnaryCall( - getChannel(), getLoginMethod(), getCallOptions(), request); - } - - /** - */ - public proto_files.User.LoginRequestAPIResponse logout(proto_files.User.Empty request) { - return blockingUnaryCall( - getChannel(), getLogoutMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class userFutureStub extends io.grpc.stub.AbstractStub { - private userFutureStub(io.grpc.Channel channel) { - super(channel); - } - - private userFutureStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected userFutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new userFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture login( - proto_files.User.LoginRequest request) { - return futureUnaryCall( - getChannel().newCall(getLoginMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture logout( - proto_files.User.Empty request) { - return futureUnaryCall( - getChannel().newCall(getLogoutMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_LOGIN = 0; - private static final int METHODID_LOGOUT = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final userImplBase serviceImpl; - private final int methodId; - - MethodHandlers(userImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_LOGIN: - serviceImpl.login((proto_files.User.LoginRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LOGOUT: - serviceImpl.logout((proto_files.User.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class userBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - userBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return proto_files.User.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("user"); - } - } - - private static final class userFileDescriptorSupplier - extends userBaseDescriptorSupplier { - userFileDescriptorSupplier() {} - } - - private static final class userMethodDescriptorSupplier - extends userBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - userMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (userGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new userFileDescriptorSupplier()) - .addMethod(getLoginMethod()) - .addMethod(getLogoutMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/usermanagement/src/main/java/user/UserService.java b/usermanagement/src/main/java/user/UserService.java deleted file mode 100644 index 8e551e80..00000000 --- a/usermanagement/src/main/java/user/UserService.java +++ /dev/null @@ -1,93 +0,0 @@ -package user; - - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.AuthenticationProvider; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -import com.nsa.webapp.LoginService; -import com.nsa.webapp.LoginServiceImpl; - -import com.nsa.webapp.UserRepository; - -//import org.lognet.springboot.grpc.GRpcService; - -import io.grpc.stub.StreamObserver; -import proto_files.User.Empty; -import proto_files.User.LoginRequest; -import proto_files.User.LoginRequestAPIResponse; -import proto_files.userGrpc.userImplBase; - -@Service -public class UserService extends userImplBase implements LoginService{ - - private UserRepository repo; - private LoginService loginservice; - - @Override - public void login(LoginRequest request, StreamObserver responseObserver) { - System.out.println("Inside User service"); - - String username= request.getUsername(); - String password= request.getPassword(); -// - LoginRequestAPIResponse.Builder response = LoginRequestAPIResponse.newBuilder(); - //System.out.println(response); - - try { - System.out.println(username); - UserDetails userdetails=this.loadUserByUsername(username); - - } - catch(Exception e) { - System.out.println(e); - } - -// - - if(username.equals(password)) { - - response.setResponseCode(0).setResponsemessage("SUCCESS"); - - } - else { -// //return failure message - response.setResponseCode(100).setResponsemessage("FAILURE"); - } -// -// - responseObserver.onNext(response.build()); - responseObserver.onCompleted(); - } -// - @Override - public void logout(Empty request, StreamObserver responseObserver) { -// - } - - //API implementation - - -// -// @Autowired -// AuthenticationProvider authenticationProvider; - - @Override - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { - - - com.nsa.webapp.User user= repo.findByUsername(username); - System.out.println("In the after method"+user.toString()); - if(user==null) { - throw new UsernameNotFoundException("USer 404"); - } - return new LoginServiceImpl(user); - } - - -} diff --git a/usermanagement/src/main/resources/application.properties b/usermanagement/src/main/resources/application.properties deleted file mode 100644 index 490a76fa..00000000 --- a/usermanagement/src/main/resources/application.properties +++ /dev/null @@ -1,7 +0,0 @@ -server.port=8082 -spring.datasource.url= jdbc:mysql://localhost:3307/tpdb -spring.datasource.username=root -spring.jpa.hibernate.ddl-auto=update -spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -spring.jpa.properties.hibernate.dialet= org.hibernate.dialect.MySQL5Dialect - diff --git a/usermanagement/src/main/resources/user.proto b/usermanagement/src/main/resources/user.proto deleted file mode 100644 index 9ece66a3..00000000 --- a/usermanagement/src/main/resources/user.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -option java_package = "proto_files"; - -service user{ - rpc login(LoginRequest) returns (LoginRequestAPIResponse); - rpc logout(Empty) returns (LoginRequestAPIResponse); -} - -message LoginRequest{ - string username = 1 ; - string password = 2 ; -} - -message LoginRequestAPIResponse{ - string responsemessage = 1; - int32 responseCode = 2; -} - -message Empty{ -} \ No newline at end of file diff --git a/usermanagement/src/main/webapp/home.jsp b/usermanagement/src/main/webapp/home.jsp deleted file mode 100644 index a2e1962a..00000000 --- a/usermanagement/src/main/webapp/home.jsp +++ /dev/null @@ -1,13 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -Insert title here - - - -Welcome aliens; - - \ No newline at end of file diff --git a/usermanagement/src/test/java/com/nsa/webapp/LatestGrpcServerApplicationTests.java b/usermanagement/src/test/java/com/nsa/webapp/LatestGrpcServerApplicationTests.java deleted file mode 100644 index f2895a80..00000000 --- a/usermanagement/src/test/java/com/nsa/webapp/LatestGrpcServerApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.nsa.webapp; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class LatestGrpcServerApplicationTests { - - @Test - void contextLoads() { - } - -}