├── Contribution License Agreement.docx ├── LICENSE.txt ├── README.md ├── RELEASE-NOTES ├── Release Notes FOSS notice file.docx ├── datarapid-api ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── datarapid │ │ │ └── api │ │ │ ├── builder │ │ │ └── ResponseBuilder.java │ │ │ ├── common │ │ │ ├── ConfigReader.java │ │ │ ├── FileTransfer.java │ │ │ └── FileTransferConfigReader.java │ │ │ ├── dto │ │ │ ├── ConfigDetails.java │ │ │ ├── DBDataDetails.java │ │ │ ├── DataGenResponse.java │ │ │ └── FileTransferDetails.java │ │ │ ├── rest │ │ │ └── DataGenService.java │ │ │ └── service │ │ │ ├── DataGenServiceBo.java │ │ │ └── impl │ │ │ └── DataGenServiceBoImpl.java │ ├── resources │ │ ├── application.properties │ │ └── datagen_api.xml │ └── webapp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ ├── shiro.ini │ │ └── web.xml │ │ ├── createDataset.html │ │ ├── dgs │ │ ├── config │ │ │ └── config.js │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── images │ │ │ │ ├── ui-icons_444444_256x240.png │ │ │ │ ├── ui-icons_555555_256x240.png │ │ │ │ ├── ui-icons_777620_256x240.png │ │ │ │ ├── ui-icons_777777_256x240.png │ │ │ │ ├── ui-icons_cc0000_256x240.png │ │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jquery-ui.css │ │ │ ├── jquery.loadmask.css │ │ │ ├── jquery.loadmask.spin.css │ │ │ └── styles.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── image │ │ │ ├── datarapid1.png │ │ │ ├── datarapid2.png │ │ │ └── loader.gif │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ ├── dgscript.js │ │ │ ├── jquery-1.11.3.js │ │ │ ├── jquery-ui.js │ │ │ ├── jquery.mask.js │ │ │ └── jquery.mask.min.js │ │ ├── index.html │ │ ├── loadRecent.html │ │ ├── login.html │ │ ├── myAccount.html │ │ ├── rolesList.html │ │ ├── settings.html │ │ └── usersList.html │ └── test │ └── java │ └── org │ └── datarapid │ └── common │ └── connectivity │ └── JRItest.java ├── datarapid-builder └── pom.xml ├── datarapid-core ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── datarapid │ │ │ └── core │ │ │ ├── StarterClass.java │ │ │ ├── StarterRoleManage.java │ │ │ ├── StarterUIRetrieval.java │ │ │ ├── StarterUserManage.java │ │ │ ├── common │ │ │ ├── BeanContext.java │ │ │ └── SpringContext.java │ │ │ ├── databuilder │ │ │ ├── BuildData.java │ │ │ ├── DataGenerator.java │ │ │ ├── ManageActivityLog.java │ │ │ ├── ManageConfiguration.java │ │ │ ├── ManageRole.java │ │ │ ├── ManageUser.java │ │ │ ├── RetrieveData.java │ │ │ ├── bucketing │ │ │ │ └── ColumnBucketing.java │ │ │ ├── datatypes │ │ │ │ ├── AlphaNumeric.java │ │ │ │ ├── AmericanCard.java │ │ │ │ ├── CVV.java │ │ │ │ ├── City.java │ │ │ │ ├── Country.java │ │ │ │ ├── Date.java │ │ │ │ ├── DefaultSet.java │ │ │ │ ├── DigitFormat.java │ │ │ │ ├── DiscoveryCreditCard.java │ │ │ │ ├── EmailAddress.java │ │ │ │ ├── FirstName.java │ │ │ │ ├── FloatRange.java │ │ │ │ ├── Guid.java │ │ │ │ ├── HexColors.java │ │ │ │ ├── HexadecimalCode.java │ │ │ │ ├── IMEI.java │ │ │ │ ├── IPAddress.java │ │ │ │ ├── IncrementalUniqueValues.java │ │ │ │ ├── IntegerRange.java │ │ │ │ ├── LastName.java │ │ │ │ ├── Location.java │ │ │ │ ├── MACAddress.java │ │ │ │ ├── MastercardNumber.java │ │ │ │ ├── NumberFormat.java │ │ │ │ ├── PanCardNumber.java │ │ │ │ ├── Password.java │ │ │ │ ├── PhoneNumber.java │ │ │ │ ├── PhoneNumberWithExt.java │ │ │ │ ├── RCommand.java │ │ │ │ ├── SSN.java │ │ │ │ ├── State.java │ │ │ │ ├── Timestamp.java │ │ │ │ ├── UniqueValues.java │ │ │ │ ├── UserDefinedRegexPattern.java │ │ │ │ ├── VisaCreditCardNumber.java │ │ │ │ └── ZipCode.java │ │ │ └── factory │ │ │ │ └── DatageneratorFactory.java │ │ │ ├── exception │ │ │ └── DataGenException.java │ │ │ ├── persistence │ │ │ ├── configuration │ │ │ │ ├── AppConfig.java │ │ │ │ └── HibernateConfiguration.java │ │ │ ├── dao │ │ │ │ ├── AbstractDao.java │ │ │ │ ├── BaseDataGeneratorDAO.java │ │ │ │ ├── BaseDataGeneratorDAOImpl.java │ │ │ │ ├── DataGeneratorActivityLogDAO.java │ │ │ │ ├── DataGeneratorActivityLogDAOImpl.java │ │ │ │ ├── DataGeneratorDataSetDAO.java │ │ │ │ ├── DataGeneratorDataSetDAOImpl.java │ │ │ │ ├── DataGeneratorRoleDAO.java │ │ │ │ ├── DataGeneratorRoleDAOImpl.java │ │ │ │ ├── DataGeneratorUserDAO.java │ │ │ │ └── DataGeneratorUserDAOImpl.java │ │ │ ├── model │ │ │ │ ├── ActivityLogInformation.java │ │ │ │ ├── DataSetInformation.java │ │ │ │ ├── LocationInfo.java │ │ │ │ ├── PersonalInfo.java │ │ │ │ ├── RoleInformation.java │ │ │ │ └── UserInformation.java │ │ │ └── transactionservice │ │ │ │ ├── ActivityLogInfoService.java │ │ │ │ ├── ActivityLogInfoServiceImpl.java │ │ │ │ ├── DataSetInfoService.java │ │ │ │ ├── DataSetInfoServiceImpl.java │ │ │ │ ├── LocationInfoService.java │ │ │ │ ├── LocationInfoServiceImpl.java │ │ │ │ ├── PersonalInfoService.java │ │ │ │ ├── PersonalInfoServiceImpl.java │ │ │ │ ├── RoleInfoService.java │ │ │ │ ├── RoleInfoServiceImpl.java │ │ │ │ ├── UserInfoService.java │ │ │ │ └── UserInfoServiceImpl.java │ │ │ ├── security │ │ │ └── SecurityUtility.java │ │ │ ├── services │ │ │ ├── DataGenCoreService.java │ │ │ └── DataGenCoreServiceImpl.java │ │ │ ├── util │ │ │ ├── CSVFileWriter.java │ │ │ ├── CommonUtils.java │ │ │ ├── Constants.java │ │ │ ├── DateGenerator.java │ │ │ ├── IntegerAndFloatRangeGenerator.java │ │ │ ├── JSONConverter.java │ │ │ ├── Messages.java │ │ │ ├── PropertyUtil.java │ │ │ ├── Rconnection.java │ │ │ ├── RegexGenerator.java │ │ │ └── TimeStampGenerator.java │ │ │ └── view │ │ │ ├── ActivityMeta.java │ │ │ ├── BucketedColumn.java │ │ │ ├── ColumnMapper.java │ │ │ ├── ColumnMeta.java │ │ │ ├── DataSetConfiguration.java │ │ │ ├── DataSetConfigurations.java │ │ │ ├── FileInfo.java │ │ │ ├── JobConfiguration.java │ │ │ ├── RoleConfiguration.java │ │ │ ├── RoleInfo.java │ │ │ ├── RoleMeta.java │ │ │ ├── UIColumnMeta.java │ │ │ ├── UIConfiguration.java │ │ │ ├── UIFileInfo.java │ │ │ ├── UserConfiguration.java │ │ │ ├── UserInfo.java │ │ │ └── UserMeta.java │ └── resources │ │ ├── datagen_core.xml │ │ └── logback.xml │ └── test │ └── java │ └── META-INF │ └── MANIFEST.MF ├── datarapid-docs ├── scripts │ ├── data.sql │ └── schema.sql └── usage │ └── Data Rapid Manual.pdf └── landing.PNG /Contribution License Agreement.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/Contribution License Agreement.docx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/README.md -------------------------------------------------------------------------------- /RELEASE-NOTES: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018 Infosys Ltd. 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | This is not an official release notes document. It exists for developers 21 | to jot down their notes while working in the source code. 22 | 23 | ########################################################### 24 | # 1.1.0 25 | ########################################################### 26 | 27 | Existing features 28 | -------------------------------- 29 | - Listing the currently available features 30 | Create large volumes of data within a couple of clicks. 31 | Generate meaningful test data at row level. 32 | Extremely fast data generation (Generates more than 10 Million records in less than 3 minutes). 33 | Improve operational efficiency. 34 | Generates the real time data (statistical distributions) as well as constant data. 35 | Facility to group the column values into factors/segments using column bucketing functionality. 36 | Generate user defined data using the regex pattern. 37 | Generate huge log files within seconds. 38 | Facility to download the file directly to your system. 39 | Reuse the configuration after saving the dataset. 40 | Sftp/ftp transfer facility for the files. 41 | 42 | -------------------------------------------------------------------------------- /Release Notes FOSS notice file.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/Release Notes FOSS notice file.docx -------------------------------------------------------------------------------- /datarapid-api/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.settings -------------------------------------------------------------------------------- /datarapid-api/src/main/java/org/datarapid/api/common/ConfigReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.api.common; 21 | 22 | import org.datarapid.api.dto.ConfigDetails; 23 | import org.slf4j.Logger; 24 | import org.slf4j.LoggerFactory; 25 | 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | import java.util.Properties; 29 | 30 | public class ConfigReader { 31 | 32 | private static final Logger log = LoggerFactory.getLogger(ConfigReader.class); 33 | 34 | public ConfigReader() { 35 | // TODO Auto-generated constructor stub 36 | } 37 | 38 | //Loading contents from the file into a {@link java.util.Properties} 39 | 40 | public ConfigDetails readConfigParameters() { 41 | 42 | Properties properties = new Properties(); 43 | InputStream inputStream = null; 44 | ConfigDetails configDetails = new ConfigDetails(); 45 | 46 | try { 47 | 48 | String fileName = "application.properties"; 49 | 50 | InputStream stream = this.getClass().getClassLoader().getResourceAsStream(fileName); 51 | if (null == stream) { 52 | log.error("{} is not available in classpath", fileName); 53 | throw new IOException(fileName + " is not available in classpath"); 54 | } 55 | 56 | properties.load(stream); 57 | configDetails.setDataGenFileTypes(properties.getProperty("dataGenFileTypes")); 58 | configDetails.setConstantBuilderDataTypes(properties.getProperty("constantBuilderDataTypes")); 59 | 60 | log.debug("Property dataGenFileTypes : ", configDetails.getDataGenFileTypes()); 61 | log.debug("Property constantBuilderDataTypes : ", configDetails.getConstantBuilderDataTypes()); 62 | 63 | } catch (IOException ex) { 64 | ex.printStackTrace(); 65 | } finally { 66 | if (inputStream != null) { 67 | try { 68 | inputStream.close(); 69 | } catch (IOException e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | } 74 | 75 | return configDetails; 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /datarapid-api/src/main/java/org/datarapid/api/dto/ConfigDetails.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.api.dto; 21 | 22 | public class ConfigDetails { 23 | 24 | private String dataGenFileTypes; 25 | 26 | private String constantBuilderDataTypes; 27 | 28 | public String getDataGenFileTypes() { 29 | return dataGenFileTypes; 30 | } 31 | 32 | public void setDataGenFileTypes(String dataGenFileTypes) { 33 | this.dataGenFileTypes = dataGenFileTypes; 34 | } 35 | 36 | public String getConstantBuilderDataTypes() { 37 | return constantBuilderDataTypes; 38 | } 39 | 40 | public void setConstantBuilderDataTypes(String constantBuilderDataTypes) { 41 | this.constantBuilderDataTypes = constantBuilderDataTypes; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /datarapid-api/src/main/java/org/datarapid/api/dto/DBDataDetails.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.api.dto; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | 26 | public class DBDataDetails { 27 | 28 | private Map> dbDatadetailsList; 29 | 30 | public Map> getDbDatadetailsList() { 31 | return dbDatadetailsList; 32 | } 33 | 34 | public void setDbDatadetailsList(Map> dbDatadetailsList) { 35 | this.dbDatadetailsList = dbDatadetailsList; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /datarapid-api/src/main/java/org/datarapid/api/dto/DataGenResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.api.dto; 21 | 22 | public class DataGenResponse { 23 | 24 | private String downloadURL; 25 | 26 | private String message; 27 | 28 | private String errorCode; 29 | 30 | public String getDownloadURL() { 31 | return downloadURL; 32 | } 33 | 34 | public void setDownloadURL(String downloadURL) { 35 | this.downloadURL = downloadURL; 36 | } 37 | 38 | public String getMessage() { 39 | return message; 40 | } 41 | 42 | public void setMessage(String message) { 43 | this.message = message; 44 | } 45 | 46 | public String getErrorCode() { 47 | return errorCode; 48 | } 49 | 50 | public void setErrorCode(String errorCode) { 51 | this.errorCode = errorCode; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /datarapid-api/src/main/java/org/datarapid/api/service/DataGenServiceBo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.api.service; 21 | 22 | import org.datarapid.api.dto.ConfigDetails; 23 | import org.datarapid.api.dto.DBDataDetails; 24 | import org.datarapid.api.dto.DataGenResponse; 25 | import org.datarapid.api.dto.FileTransferDetails; 26 | import org.datarapid.core.view.DataSetConfigurations; 27 | import org.datarapid.core.view.JobConfiguration; 28 | import org.datarapid.core.view.RoleConfiguration; 29 | import org.datarapid.core.view.UserConfiguration; 30 | 31 | public interface DataGenServiceBo { 32 | 33 | String processTestData(); 34 | 35 | ConfigDetails processConfigDetailsRetrieval(); 36 | 37 | DBDataDetails processDBDataRetrieval(); 38 | 39 | DataGenResponse processFileTransfer(FileTransferDetails fileTransferDetails); 40 | 41 | DataGenResponse processData(JobConfiguration configuration); 42 | 43 | DataGenResponse createUser(UserConfiguration configuration); 44 | 45 | DataGenResponse updateUser(UserConfiguration configuration); 46 | 47 | DataGenResponse deleteUser(UserConfiguration configuration); 48 | 49 | UserConfiguration queryUser(String userName); 50 | 51 | UserConfiguration queryUsers(); 52 | 53 | DataGenResponse createRole(RoleConfiguration configuration); 54 | 55 | DataGenResponse updateRole(RoleConfiguration configuration); 56 | 57 | DataGenResponse deleteRole(RoleConfiguration configuration); 58 | 59 | RoleConfiguration queryRole(String userName); 60 | 61 | RoleConfiguration queryRoles(); 62 | 63 | DataGenResponse authenticateUser(String userName, String password, String operation); 64 | 65 | DataGenResponse userLogout(); 66 | 67 | DataGenResponse saveConfiguration(JobConfiguration configuration); 68 | 69 | JobConfiguration queryDataset(String datasetName); 70 | 71 | DataSetConfigurations queryDatasets(); 72 | 73 | DataGenResponse updateConfiguration(JobConfiguration configuration); 74 | 75 | DataGenResponse deleteConfiguration(JobConfiguration configuration); 76 | 77 | DataGenResponse getLoggedInUser(); 78 | 79 | } -------------------------------------------------------------------------------- /datarapid-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | #* Copyright 2018 Infosys Ltd. 3 | #* 4 | #* Licensed to the Apache Software Foundation (ASF) under one or more 5 | #* contributor license agreements. See the NOTICE file distributed with 6 | #* this work for additional information regarding copyright ownership. 7 | #* The ASF licenses this file to You under the Apache License, Version 2.0 8 | #* (the "License"); you may not use this file except in compliance with 9 | #* the License. You may obtain a copy of the License at 10 | #* 11 | #* http://www.apache.org/licenses/LICENSE-2.0 12 | #* 13 | #* Unless required by applicable law or agreed to in writing, software 14 | #* distributed under the License is distributed on an "AS IS" BASIS, 15 | #* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | #* See the License for the specific language governing permissions and 17 | #* limitations under the License. 18 | # 19 | 20 | # Basic Configurations 21 | numberOfRows=1000 22 | threadCount=7 23 | tempDirectory=D:\\\\tmp\\\\datagentempfiles 24 | dbTypeDropDownLimit=1000 25 | 26 | # Admin user 27 | datagenadmin=admin 28 | 29 | # R connect details 30 | rconnectip= 31 | rconnectport=6311 32 | 33 | # File Transfer details 34 | defaultFileTransferType=download 35 | fileTransferType=download 36 | fileName= 37 | host= 38 | userId= 39 | password= 40 | remoteDirectory= 41 | localDirectory= 42 | 43 | # Persistance Details 44 | jdbc.driverClassName = com.mysql.jdbc.Driver 45 | jdbc.url = jdbc:mysql://localhost:3306/datarapid 46 | jdbc.username =root 47 | jdbc.password =root 48 | hibernate.dialect = org.hibernate.dialect.MySQLDialect 49 | hibernate.show_sql = true 50 | hibernate.format_sql = false 51 | 52 | # UI configs 53 | dataGenFileTypes=CSV 54 | constantBuilderDataTypes=Digits,Number,Currency,Regex,Date,Alpha,AlphaWithSpaces,SSN,State,StateShort,Country,SymbolNASDAQ,SymbolNotNASDAQ,SecurityNameNASDAQ,SecurityNameNotNASDAQ,PhoneDomesticUSA,PhoneDomesticUSAWithExt,Zip,Set 55 | -------------------------------------------------------------------------------- /datarapid-api/src/main/resources/datagen_api.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/WEB-INF/shiro.ini: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013 Les Hazlewood and contributors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # INI configuration is very powerful and flexible, while still remaining succinct. 18 | # Please http://shiro.apache.org/configuration.html and 19 | # http://shiro.apache.org/web.html for more. 20 | 21 | [main] 22 | authc.loginUrl = /login.html 23 | authc.usernameParam = username 24 | authc.passwordParam = password 25 | authc.rememberMeParam = remember 26 | authc.successUrl = /index.html 27 | authc.failureKeyAttribute=simpleShiroApplicationLoginFailure 28 | jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm 29 | jdbcRealm.authenticationQuery = select user_password from users where user_name = ? 30 | jdbcRealm.userRolesQuery = SELECT ur.role_name FROM user_roles ur WHERE ur.user_name = ? 31 | ds = com.mysql.jdbc.jdbc2.optional.MysqlDataSource 32 | ds.serverName = localhost 33 | ds.user = root 34 | ds.password =root 35 | ds.databaseName = datarapid 36 | jdbcRealm.dataSource = $ds 37 | matcher = org.apache.shiro.authc.credential.PasswordMatcher 38 | jdbcRealm.credentialsMatcher = $matcher 39 | cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager 40 | securityManager.cacheManager = $cacheManager 41 | logout.redirectUrl = /login 42 | 43 | [urls] 44 | /login.html = authc 45 | /index.html = authc 46 | /logout = logout 47 | /datarapid-api/**=authc 48 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | Data Rapid 25 | 26 | 27 | login.html 28 | 29 | 30 | 31 | contextConfigLocation 32 | classpath:datagen_api.xml 33 | 34 | 35 | 36 | org.springframework.web.context.ContextLoaderListener 37 | 38 | 39 | 40 | org.apache.shiro.web.env.EnvironmentLoaderListener 41 | 42 | 43 | 44 | ShiroFilter 45 | org.apache.shiro.web.servlet.ShiroFilter 46 | 47 | 48 | 49 | ShiroFilter 50 | /* 51 | REQUEST 52 | FORWARD 53 | INCLUDE 54 | ERROR 55 | 56 | 57 | 58 | 30 59 | 60 | 61 | 62 | jersey-serlvet 63 | com.sun.jersey.spi.spring.container.servlet.SpringServlet 64 | 65 | com.sun.jersey.config.property.packages 66 | org.datarapid.api.rest 67 | 68 | 69 | com.sun.jersey.api.json.POJOMappingFeature 70 | true 71 | 72 | 1 73 | 74 | 75 | 76 | jersey-serlvet 77 | /rest/* 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/config/config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | configparams = { 21 | enabled: true, 22 | port: '8998' , 23 | defaultport: '8080' 24 | } -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/css/jquery.loadmask.css: -------------------------------------------------------------------------------- 1 | .loadmask { 2 | z-index: 100; 3 | position: absolute; 4 | top:0; 5 | left:0; 6 | -moz-opacity: 0.5; 7 | opacity: .50; 8 | filter: alpha(opacity=50); 9 | background-color: #CCC; 10 | width: 100%; 11 | height: 100%; 12 | zoom: 1; 13 | } 14 | .loadmask-msg { 15 | z-index: 20001; 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | border:1px solid #6593cf; 20 | background: #c3daf9; 21 | padding:2px; 22 | } 23 | .loadmask-msg div { 24 | padding:5px 10px 5px 25px; 25 | background: #fbfbfb url('../images/loading.gif') no-repeat 5px 5px; 26 | line-height: 16px; 27 | border:1px solid #a3bad9; 28 | color:#222; 29 | font:normal 11px tahoma, arial, helvetica, sans-serif; 30 | cursor:wait; 31 | } 32 | .masked { 33 | overflow: hidden !important; 34 | } 35 | .masked-relative { 36 | position: relative !important; 37 | } 38 | .masked-hidden { 39 | visibility: hidden !important; 40 | } -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/image/datarapid1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/image/datarapid1.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/image/datarapid2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/image/datarapid2.png -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/dgs/image/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-api/src/main/webapp/dgs/image/loader.gif -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/loadRecent.html: -------------------------------------------------------------------------------- 1 | 19 |
20 |
21 |
22 |
23 |
24 |
25 |

Available Datasets

26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
File NameUser NameCreated DateActions
41 |
42 |
43 | 44 |
45 |
46 |
47 |
-------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/login.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | Data Rapid : Login 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 41 | 42 |
43 |
44 |

45 | 46 |
47 | 48 |
49 |





50 | 56 | 57 |
58 |
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/myAccount.html: -------------------------------------------------------------------------------- 1 | 19 |

20 | 21 | 22 |
23 |
24 |

Update Account Information

25 |

26 |
27 |
29 |
30 | 32 |
33 |
34 |
35 | 37 |
38 | 40 |
41 |
42 |
43 | 44 |
45 | 47 |
48 |
49 |
50 | 52 |
53 | 55 |
56 |
57 |
58 | 60 |
61 | 63 |
64 |
65 |
66 |
67 | 68 | 69 |
70 |
71 |
72 |
73 |
74 | 75 | -------------------------------------------------------------------------------- /datarapid-api/src/main/webapp/usersList.html: -------------------------------------------------------------------------------- 1 | 19 |
20 |
21 |
22 |
23 |
24 |
25 |

Existing Users

26 |
27 |
28 | 29 | 31 |     32 |
33 |
34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
User NameDescriptionCreated DateCreated ByActions
50 |
51 |
52 | 53 |
54 |
55 | 57 |
58 | 60 |
61 |
62 |
63 | 65 |
66 | 68 |
69 |
70 |
71 | 73 |
74 | 75 |
76 |
77 |
78 | 80 |
81 | 82 |
83 |
84 |
85 | 86 |
87 | 88 |
89 |
90 |
91 |
92 |
93 |
94 | -------------------------------------------------------------------------------- /datarapid-api/src/test/java/org/datarapid/common/connectivity/JRItest.java: -------------------------------------------------------------------------------- 1 | package org.datarapid.common.connectivity; 2 | 3 | //import org.rosuda.JRI.Rengine; 4 | 5 | public class JRItest 6 | { 7 | public static void main (String[] args) 8 | { 9 | // new R-engine 10 | /* Rengine re=new Rengine (new String [] {"--vanilla"}, false, null); 11 | if (!re.waitForR()) 12 | { 13 | System.out.println ("Cannot load R"); 14 | return; 15 | } 16 | 17 | // print a random number from uniform distribution 18 | System.out.println (re.eval ("runif(1)").asDouble ()); 19 | 20 | // done... 21 | re.end();*/ 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /datarapid-builder/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 4.0.0 22 | org.datarapid 23 | datarapid-builder 24 | 0.0.1-SNAPSHOT 25 | pom 26 | Data Rapid - Parent Project Builder 27 | 28 | ../datarapid-core 29 | ../datarapid-api 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework 37 | spring-core 38 | ${spring.version} 39 | 40 | 41 | org.springframework 42 | spring-context 43 | ${spring.version} 44 | 45 | 46 | org.springframework 47 | spring-beans 48 | ${spring.version} 49 | 50 | 51 | 52 | 4.2.3.RELEASE 53 | 54 | -------------------------------------------------------------------------------- /datarapid-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.settings 4 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/StarterUIRetrieval.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core; 21 | 22 | import org.datarapid.core.services.DataGenCoreServiceImpl; 23 | import org.datarapid.core.view.UIColumnMeta; 24 | import org.datarapid.core.view.UIConfiguration; 25 | import org.datarapid.core.view.UIFileInfo; 26 | import org.springframework.context.ApplicationContext; 27 | import org.springframework.context.support.ClassPathXmlApplicationContext; 28 | 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | import java.util.Map; 32 | 33 | /** 34 | * @Description : Test Main Class 35 | */ 36 | public class StarterUIRetrieval { 37 | 38 | public static void main(String[] args) { 39 | 40 | UIColumnMeta meta1 = new UIColumnMeta("firstname", "1000"); 41 | UIColumnMeta meta2 = new UIColumnMeta("lastname", "1000"); 42 | UIColumnMeta meta3 = new UIColumnMeta("emailaddress", "1000"); 43 | UIColumnMeta meta4 = new UIColumnMeta("zipcode", "1000"); 44 | UIColumnMeta meta5 = new UIColumnMeta("city", "1000"); 45 | UIColumnMeta meta6 = new UIColumnMeta("state", "1000"); 46 | UIColumnMeta meta7 = new UIColumnMeta("country", "1000"); 47 | UIColumnMeta meta8 = new UIColumnMeta("location", "1000"); 48 | 49 | List list = new ArrayList(); 50 | list.add(meta1); 51 | list.add(meta2); 52 | list.add(meta3); 53 | list.add(meta4); 54 | list.add(meta5); 55 | list.add(meta6); 56 | list.add(meta7); 57 | list.add(meta8); 58 | 59 | UIFileInfo fileInfo = new UIFileInfo(list); 60 | UIConfiguration configuration = new UIConfiguration("firstname", "1000", fileInfo); 61 | 62 | @SuppressWarnings("resource") 63 | ApplicationContext context = new ClassPathXmlApplicationContext("datagen_core.xml"); 64 | DataGenCoreServiceImpl dataGenCoreServiceImpl = (DataGenCoreServiceImpl) context 65 | .getBean("dataGenCoreServiceImpl"); 66 | 67 | Map> finalList = null; 68 | 69 | try { 70 | 71 | finalList = dataGenCoreServiceImpl.retrieveData(configuration); 72 | } catch (Exception e) { 73 | System.out.println("in exception"); 74 | e.printStackTrace(); 75 | } 76 | 77 | System.out.println("over and out"); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/common/BeanContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.common; 21 | 22 | import org.springframework.context.ApplicationContext; 23 | import org.springframework.context.support.ClassPathXmlApplicationContext; 24 | 25 | public class BeanContext { 26 | 27 | private static ApplicationContext appContext; 28 | 29 | private static BeanContext beanContext; 30 | 31 | static { 32 | appContext = new ClassPathXmlApplicationContext("datagen_core.xml"); 33 | } 34 | 35 | private BeanContext() { 36 | 37 | } 38 | 39 | public static BeanContext getInstance() { 40 | if (null == beanContext) { 41 | beanContext = new BeanContext(); 42 | } 43 | return beanContext; 44 | } 45 | 46 | @SuppressWarnings("unchecked") 47 | public T getBean(String beanName) { 48 | return (T) appContext.getBean(beanName); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/common/SpringContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.common; 21 | 22 | 23 | public class SpringContext { 24 | 25 | private static BeanContext beanContext = BeanContext.getInstance(); 26 | 27 | public static T getBean(String beanName) { 28 | return beanContext.getBean(beanName); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/DataGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @Description 26 | */ 27 | public interface DataGenerator { 28 | 29 | public List getColumn(String values, int numRows); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/ManageActivityLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.persistence.model.ActivityLogInformation; 24 | import org.datarapid.core.persistence.transactionservice.ActivityLogInfoService; 25 | import org.datarapid.core.view.ActivityMeta; 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | 30 | /** 31 | * @Description :- This class is for managing activity log. 32 | */ 33 | 34 | public class ManageActivityLog { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(ManageActivityLog.class); 37 | 38 | public ManageActivityLog() { 39 | // TODO Auto-generated constructor stub 40 | } 41 | 42 | /** 43 | * @Description For creating the activity log 44 | */ 45 | 46 | @Autowired 47 | private ActivityLogInformation activityLogInformation; 48 | 49 | public boolean logActivity(ActivityMeta activityMeta) { 50 | 51 | ActivityLogInfoService infoService = SpringContext.getBean("activityLogInfoService"); 52 | if (activityMeta.getLogId() ==0){ 53 | activityLogInformation = new ActivityLogInformation(); 54 | } 55 | activityLogInformation.setLogId(activityMeta.getLogId()); 56 | activityLogInformation.setTriggeredUserName(activityMeta.getTriggeredUserName()); 57 | activityLogInformation.setActivityDate(activityMeta.getActivityDate()); 58 | activityLogInformation.setGeneratedFileName(activityMeta.getGeneratedFileName()); 59 | activityLogInformation.setProcessedRecordCount(activityMeta.getProcessedRecordCount()); 60 | activityLogInformation.setProcessedUsage(activityMeta.getProcessedUsage()); 61 | boolean logActivity = infoService.logActivity(activityLogInformation); 62 | return logActivity; 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/AlphaNumeric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Returns a list of alphanumeric code. 33 | */ 34 | public class AlphaNumeric implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(AlphaNumeric.class); 37 | 38 | @SuppressWarnings("finally") 39 | public List getColumn(String values, int numRows) { 40 | 41 | List resultColumn = new ArrayList(); 42 | try { 43 | 44 | String[] breaker = values.trim().split(COMMA_SPLIT); 45 | 46 | // numberOfDigits,numberOfAlphabets 47 | String regex = "^[1-9]{" + breaker[0].trim() + "}[a-z]{" + breaker[1].trim() + "}$"; 48 | resultColumn = getRegex(regex, numRows); 49 | } catch (Exception e) { 50 | // TODO Auto-generated catch block 51 | logger.error("Exception occured due to improper input " + e); 52 | } finally { 53 | return resultColumn; 54 | 55 | } 56 | } 57 | 58 | @SuppressWarnings("finally") 59 | public List getRegex(String regExPattern, int numRows) { 60 | 61 | List listOfColumns = new ArrayList(numRows); 62 | 63 | try { 64 | RegexGenerator generator = new RegexGenerator(); 65 | for (int i = 0; i < numRows; i++) { 66 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 67 | 68 | } 69 | } catch (ArrayIndexOutOfBoundsException e) { 70 | logger.error("Exception occured due to improper input " + e); 71 | } finally { 72 | 73 | return listOfColumns; 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/AmericanCard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Returns a list of AmericanCard numbers. 33 | */ 34 | public class AmericanCard implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(AmericanCard.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | return getRegex(AMERICANCARDREGEX, numRows); 40 | } 41 | 42 | public List getRegex(String regExPattern, int numRows) { 43 | 44 | List listOfColumns = new ArrayList(numRows); 45 | 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | // TODO Auto-generated catch block 55 | logger.debug("Error in AmericanCard class " + e); 56 | } 57 | return listOfColumns; 58 | 59 | } 60 | 61 | ; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/CVV.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Returns the list of CVV . 33 | */ 34 | public class CVV implements DataGenerator, Constants { 35 | 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(CVV.class); 38 | 39 | public List getColumn(String values, int numRows) { 40 | 41 | return getRegex(CVVREGEX, numRows); 42 | } 43 | 44 | public List getRegex(String regExPattern, int numRows) { 45 | 46 | List listOfColumns = new ArrayList(numRows); 47 | 48 | try { 49 | RegexGenerator generator = new RegexGenerator(); 50 | for (int i = 0; i < numRows; i++) { 51 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 52 | 53 | } 54 | } catch (Exception e) { 55 | // TODO Auto-generated catch block 56 | logger.error("Error in CVV class " + e); 57 | } 58 | 59 | return listOfColumns; 60 | 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/City.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.LocationInfo; 25 | import org.datarapid.core.persistence.transactionservice.LocationInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Returns a list of cities from the database. 32 | */ 33 | public class City implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | 37 | List list = getLocationInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getLocationInfoFromDB(int noOfValues) { 42 | LocationInfoService infoService = SpringContext.getBean("locationInfoService"); 43 | 44 | List infos = infoService.findAllLocation(); 45 | List list = new ArrayList(); 46 | 47 | int interm = noOfValues / 80000; 48 | int remains = noOfValues % 80000; 49 | 50 | if (interm == 0) { 51 | 52 | for (int j = 1; j <= noOfValues; j++) { 53 | list.add(infos.get(j).getCity()); 54 | } 55 | } else { 56 | for (int m = 0; m < interm; m++) { 57 | 58 | // if we limit this number of entries from database to 5000 59 | // ,else you can change your value 60 | for (int j = 0; j < 80000; j++) { 61 | 62 | list.add(infos.get(j).getCity()); 63 | 64 | } 65 | 66 | } 67 | for (int j = 0; j < remains; j++) { 68 | list.add(infos.get(j).getCity()); 69 | } 70 | } 71 | return list; 72 | 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Country.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.LocationInfo; 25 | import org.datarapid.core.persistence.transactionservice.LocationInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Returns a list of countries from the database. 32 | */ 33 | public class Country implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | 37 | List list = getLocationInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getLocationInfoFromDB(int noOfValues) { 42 | LocationInfoService infoService = SpringContext.getBean("locationInfoService"); 43 | 44 | List infos = infoService.findAllLocation(); 45 | List list = new ArrayList(); 46 | 47 | int interm = noOfValues / 80000; 48 | int remains = noOfValues % 80000; 49 | 50 | if (interm == 0) { 51 | 52 | for (int j = 1; j <= noOfValues; j++) { 53 | list.add(infos.get(j).getCountry()); 54 | } 55 | } else { 56 | for (int m = 0; m < interm; m++) { 57 | 58 | // if we limit this number of entries from database to 5000 59 | // ,else you can change your value 60 | for (int j = 0; j < 80000; j++) { 61 | 62 | list.add(infos.get(j).getCountry()); 63 | 64 | } 65 | 66 | } 67 | for (int j = 0; j < remains; j++) { 68 | list.add(infos.get(j).getCountry()); 69 | } 70 | } 71 | 72 | return list; 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Date.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.DateGenerator; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description This class will generate list of random date between the 29 | * StartDate and the EndDate.The user will have to give the input 30 | * in the dd/mm/yyyy format only and then he can specify his own 31 | * desired output format using the # separator . The format is 32 | * "StartDate-EndDate#outputSimpleDateFormat" for ex:- 33 | * 01/01/1993-01/01/1994#mm/dd/yyyy 34 | */ 35 | public class Date implements DataGenerator { 36 | 37 | public List getColumn(String values, int numRows) { 38 | DateGenerator dateGenerator = new DateGenerator(); 39 | List list = dateGenerator.generateDate(values.trim(), numRows); 40 | return list; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/DefaultSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description This class will generate a list with random values from the user 32 | * defined set. 33 | */ 34 | public class DefaultSet implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(DefaultSet.class); 37 | 38 | public List getColumn(String userInputSet, int numRows) { 39 | 40 | List list = generateDefaultSet(userInputSet, numRows); 41 | return list; 42 | } 43 | 44 | public List generateDefaultSet(String userInputSet, int noOfValues) { 45 | 46 | List list = new ArrayList(); 47 | 48 | try { 49 | String[] setValues = userInputSet.split(COMMA_SPLIT); 50 | 51 | int min = 0; 52 | int max = setValues.length - 1; 53 | 54 | for (int i = 0; i < noOfValues; i++) { 55 | 56 | list.add(setValues[min + (int) (Math.random() * ((max - min) + 1))]); 57 | 58 | } 59 | } catch (Exception e) { 60 | 61 | logger.error("Error in Default Set Class " + e); 62 | } 63 | return list; 64 | 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/DigitFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.RegexGenerator; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of whole numbers. 32 | */ 33 | public class DigitFormat implements DataGenerator { 34 | 35 | private static final Logger logger = LoggerFactory.getLogger(DigitFormat.class); 36 | 37 | public List getColumn(String values, int numRows) { 38 | 39 | List resultColumn = new ArrayList(); 40 | 41 | try { 42 | String regex = "^[1-9]{" + values.trim() + "}$"; 43 | resultColumn = getRegex(regex, numRows); 44 | } catch (Exception e) { 45 | // TODO Auto-generated catch block 46 | logger.error("Error in DigitFormat class " + e); 47 | } 48 | 49 | return resultColumn; 50 | } 51 | 52 | public List getRegex(String regExPattern, int numRows) { 53 | 54 | List listOfColumns = new ArrayList(); 55 | 56 | try { 57 | RegexGenerator generator = new RegexGenerator(); 58 | listOfColumns = new ArrayList(numRows); 59 | for (int i = 0; i < numRows; i++) { 60 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 61 | 62 | } 63 | } catch (Exception e) { 64 | // TODO Auto-generated catch block 65 | logger.error("Error in DigitFormat class " + e); 66 | } 67 | return listOfColumns; 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/DiscoveryCreditCard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | public class DiscoveryCreditCard implements DataGenerator, Constants { 32 | private static final Logger logger = LoggerFactory.getLogger(DiscoveryCreditCard.class); 33 | 34 | public List getColumn(String values, int numRows) { 35 | return getRegex(DISCOVERYCARDREGEXPATTERN, numRows); 36 | } 37 | 38 | public List getRegex(String regExPattern, int numRows) { 39 | 40 | List listOfColumns = new ArrayList(numRows); 41 | 42 | 43 | try { 44 | RegexGenerator generator = new RegexGenerator(); 45 | for (int i = 0; i < numRows; i++) { 46 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 47 | 48 | } 49 | } catch (Exception e) { 50 | // TODO Auto-generated catch block 51 | logger.debug("Error in AmericanCard class " + e); 52 | } 53 | return listOfColumns; 54 | 55 | } 56 | 57 | public static void main(String[] args) { 58 | DiscoveryCreditCard card = new DiscoveryCreditCard(); 59 | System.out.println(card.getColumn("^6(?:011|5[0-9]{2})[0-9]{12}$", 100)); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/EmailAddress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.PersonalInfo; 25 | import org.datarapid.core.persistence.transactionservice.PersonalInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of email-addresses from the database. 32 | */ 33 | public class EmailAddress implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | 37 | List list = getPersonalInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getPersonalInfoFromDB(int noOfValues) { 42 | 43 | PersonalInfoService addressService = SpringContext.getBean("personalInfoService"); 44 | 45 | List emailAddressBeans = (List) addressService.findAllDetails(); 46 | 47 | List list = new ArrayList(); 48 | 49 | int interm = noOfValues / 5000; 50 | int remains = noOfValues % 5000; 51 | 52 | if (interm == 0) { 53 | 54 | for (int p = 1; p <= noOfValues; p++) { 55 | 56 | list.add(emailAddressBeans.get(p).getEmailAddress().trim()); 57 | 58 | } 59 | } else { 60 | for (int i = 0; i < interm; i++) { 61 | 62 | for (int j = 0; j < 5000; j++) { 63 | list.add(emailAddressBeans.get(j).getEmailAddress().trim()); 64 | 65 | } 66 | } 67 | for (int i = 0; i < remains; i++) { 68 | list.add(emailAddressBeans.get(i).getEmailAddress().trim()); 69 | } 70 | } 71 | 72 | return list; 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/FirstName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.PersonalInfo; 25 | import org.datarapid.core.persistence.transactionservice.PersonalInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of first names from the database. 32 | */ 33 | public class FirstName implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | // TODO Auto-generated method stub 37 | List list = getPersonalInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getPersonalInfoFromDB(int noOfValues) { 42 | 43 | PersonalInfoService addressService = SpringContext.getBean("personalInfoService"); 44 | 45 | List emailAddressBeans = (List) addressService.findAllDetails(); 46 | 47 | List list = new ArrayList(); 48 | 49 | int interm = noOfValues / 5000; 50 | int remains = noOfValues % 5000; 51 | 52 | if (interm == 0) { 53 | 54 | for (int p = 1; p <= noOfValues; p++) { 55 | 56 | list.add(emailAddressBeans.get(p).getFirstName()); 57 | 58 | } 59 | } else { 60 | for (int i = 0; i < interm; i++) { 61 | 62 | for (int j = 0; j < 5000; j++) { 63 | list.add(emailAddressBeans.get(j).getFirstName()); 64 | 65 | } 66 | } 67 | for (int i = 0; i < remains; i++) { 68 | list.add(emailAddressBeans.get(i).getFirstName()); 69 | 70 | } 71 | } 72 | 73 | return list; 74 | 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/FloatRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.IntegerAndFloatRangeGenerator; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description This class generates the random float values between the range 32 | * given by the user. The user should give the input in the format 33 | * "startValue to endValue". 34 | */ 35 | 36 | public class FloatRange implements DataGenerator { 37 | 38 | private static final Logger logger = LoggerFactory.getLogger(FloatRange.class); 39 | 40 | /** 41 | * @param values,numRows 42 | * @Description invokes the getRange method and returns the list of float 43 | * range 44 | */ 45 | public List getColumn(String values, int numRows) { 46 | 47 | List list = getRange(values.trim(), numRows); 48 | return list; 49 | } 50 | 51 | /** 52 | * @param values,numRows 53 | * @Description Populates the list with float range and return the list. 54 | */ 55 | public List getRange(String value, int numRows) { 56 | List list = new ArrayList(); 57 | 58 | try { 59 | IntegerAndFloatRangeGenerator generator = new IntegerAndFloatRangeGenerator(); 60 | 61 | for (int i = 0; i < numRows; i++) { 62 | list.add(generator.generateRandomFloat(value)); 63 | } 64 | } catch (Exception e) { 65 | logger.error("Error in Float range class " + e); 66 | 67 | } 68 | return list; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Guid.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of Guid. 33 | */ 34 | public class Guid implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(Guid.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | 40 | return getRegex(GUIDREGEX, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | 48 | try { 49 | RegexGenerator generator = new RegexGenerator(); 50 | for (int i = 0; i < numRows; i++) { 51 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 52 | 53 | } 54 | } catch (Exception e) { 55 | logger.error("Guid class error.Check Regex Generator class " + e); 56 | } 57 | return listOfColumns; 58 | 59 | } 60 | 61 | ; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/HexColors.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of HexColors. 33 | */ 34 | public class HexColors implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(HexColors.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | return getRegex(HEXCOLORSREGEX, numRows); 40 | } 41 | 42 | public List getRegex(String regExPattern, int numRows) { 43 | 44 | List listOfColumns = new ArrayList(numRows); 45 | 46 | try { 47 | RegexGenerator generator = new RegexGenerator(); 48 | for (int i = 0; i < numRows; i++) { 49 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 50 | 51 | } 52 | } catch (Exception e) { 53 | logger.error("Error in Hexcolors class " + e); 54 | } 55 | return listOfColumns; 56 | 57 | } 58 | 59 | ; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/HexadecimalCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of HexadecimalCode. 33 | */ 34 | public class HexadecimalCode implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(HexadecimalCode.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | return getRegex(HEXADECIMALREGEX, numRows); 40 | } 41 | 42 | public List getRegex(String regExPattern, int numRows) { 43 | 44 | List listOfColumns = new ArrayList(numRows); 45 | 46 | try { 47 | RegexGenerator generator = new RegexGenerator(); 48 | for (int i = 0; i < numRows; i++) { 49 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 50 | 51 | } 52 | } catch (Exception e) { 53 | logger.error("Error in HexadecimalCode class " + e); 54 | } 55 | return listOfColumns; 56 | 57 | } 58 | 59 | ; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/IMEI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | public class IMEI implements DataGenerator, Constants { 32 | 33 | private static final Logger logger = LoggerFactory.getLogger(AmericanCard.class); 34 | 35 | public List getColumn(String values, int numRows) { 36 | return getRegex(IMEIREGEX, numRows); 37 | } 38 | 39 | public List getRegex(String regExPattern, int numRows) { 40 | 41 | List listOfColumns = new ArrayList(numRows); 42 | 43 | try { 44 | RegexGenerator generator = new RegexGenerator(); 45 | for (int i = 0; i < numRows; i++) { 46 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 47 | 48 | } 49 | } catch (Exception e) { 50 | // TODO Auto-generated catch block 51 | logger.debug("Error in IMEI class " + e); 52 | } 53 | return listOfColumns; 54 | 55 | } 56 | 57 | ; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/IPAddress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of IPAddresses. 33 | */ 34 | public class IPAddress implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(IPAddress.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | 40 | return getRegex(IPADDRESS, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | logger.error("Error in IPAddress class " + e); 55 | } 56 | return listOfColumns; 57 | 58 | } 59 | 60 | ; 61 | } 62 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/IncrementalUniqueValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | public class IncrementalUniqueValues implements DataGenerator, Constants { 31 | 32 | // user input will be of the format 10-100,2 incrementing value 33 | 34 | private static final Logger logger = LoggerFactory.getLogger(AmericanCard.class); 35 | 36 | public List getColumn(String values, int numRows) { 37 | return getRegex(values.trim(), numRows); 38 | } 39 | 40 | public List getRegex(String values, int numRows) { 41 | 42 | List listOfColumns = new ArrayList(numRows); 43 | 44 | try { 45 | String[] splitter = values.split(","); 46 | String[] lowerLimit = splitter[0].split("to"); 47 | int startingValue = Integer.valueOf(lowerLimit[0].trim()); 48 | int incrementBy = Integer.valueOf(splitter[1].trim()); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(String.valueOf(startingValue)); 51 | startingValue = startingValue + incrementBy; 52 | 53 | } 54 | } catch (ArrayIndexOutOfBoundsException e) { 55 | logger.error("Error in IncrementalUniqueValues.The input format entered is wrong"); 56 | } 57 | return listOfColumns; 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/IntegerRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.IntegerAndFloatRangeGenerator; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Returns the list of random integers between the startValue and 32 | * the EndValue.User will have to give input in the format 33 | * "startvalue to endvalue" 34 | */ 35 | public class IntegerRange implements DataGenerator { 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(IntegerRange.class); 38 | 39 | /** 40 | * @param values,numRows 41 | * @Description invokes the getRange method and returns the list of integer 42 | * range 43 | */ 44 | public List getColumn(String values, int numRows) { 45 | List list = getRange(values.trim(), numRows); 46 | return list; 47 | } 48 | 49 | /** 50 | * @param values,numRows 51 | * @Description Populates the list with integer range and return the list. 52 | */ 53 | public List getRange(String value, int numRows) { 54 | List list = new ArrayList(); 55 | 56 | try { 57 | IntegerAndFloatRangeGenerator generator = new IntegerAndFloatRangeGenerator(); 58 | 59 | for (int i = 0; i < numRows; i++) { 60 | list.add(generator.generateRandomInteger(value)); 61 | } 62 | } catch (Exception e) { 63 | logger.error("Error in IntegerRange class " + e); 64 | } 65 | return list; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/LastName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.PersonalInfo; 25 | import org.datarapid.core.persistence.transactionservice.PersonalInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of LastNames. 32 | */ 33 | public class LastName implements DataGenerator { 34 | public List getColumn(String values, int numRows) { 35 | // TODO Auto-generated method stub 36 | List list = getPersonalInfoFromDB(numRows); 37 | return list; 38 | } 39 | 40 | public List getPersonalInfoFromDB(int noOfValues) { 41 | 42 | PersonalInfoService addressService = SpringContext.getBean("personalInfoService"); 43 | 44 | List emailAddressBeans = (List) addressService.findAllDetails(); 45 | 46 | List list = new ArrayList(); 47 | 48 | int interm = noOfValues / 5000; 49 | int remains = noOfValues % 5000; 50 | 51 | if (interm == 0) { 52 | 53 | for (int p = 1; p <= noOfValues; p++) { 54 | 55 | list.add(emailAddressBeans.get(p).getLastName()); 56 | 57 | } 58 | } else { 59 | for (int i = 0; i < interm; i++) { 60 | 61 | for (int j = 0; j < 5000; j++) { 62 | list.add(emailAddressBeans.get(j).getLastName()); 63 | 64 | } 65 | } 66 | for (int i = 0; i < remains; i++) { 67 | list.add(emailAddressBeans.get(i).getLastName()); 68 | } 69 | } 70 | 71 | return list; 72 | 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Location.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.LocationInfo; 25 | import org.datarapid.core.persistence.transactionservice.LocationInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of Locations. 32 | */ 33 | public class Location implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | 37 | List list = getLocationInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getLocationInfoFromDB(int noOfValues) { 42 | 43 | LocationInfoService infoService = SpringContext.getBean("locationInfoService"); 44 | 45 | List infos = infoService.findAllLocation(); 46 | List list = new ArrayList(); 47 | 48 | int interm = noOfValues / 80000; 49 | int remains = noOfValues % 80000; 50 | 51 | if (interm == 0) { 52 | 53 | for (int j = 1; j <= noOfValues; j++) { 54 | list.add(infos.get(j).getLocation().trim()); 55 | } 56 | } else { 57 | for (int m = 0; m < interm; m++) { 58 | 59 | // if we limit this number of entries from database to 5000 60 | // ,else you can change your value 61 | for (int j = 0; j < 80000; j++) { 62 | 63 | list.add(infos.get(j).getLocation().trim()); 64 | 65 | } 66 | 67 | } 68 | for (int j = 0; j < remains; j++) { 69 | list.add(infos.get(j).getLocation().trim()); 70 | } 71 | } 72 | return list; 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/MACAddress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of MAC Addresses. 33 | */ 34 | public class MACAddress implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(MACAddress.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | 40 | return getRegex(MACADDRESS, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | logger.error("Error in MACAddress class " + e); 55 | } 56 | return listOfColumns; 57 | 58 | } 59 | 60 | ; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/MastercardNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of Mastercard credit card Numbers. 33 | */ 34 | public class MastercardNumber implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(MastercardNumber.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | return getRegex(MASTERCARDNUMBER, numRows); 40 | } 41 | 42 | public List getRegex(String regExPattern, int numRows) { 43 | 44 | List listOfColumns = new ArrayList(numRows); 45 | 46 | try { 47 | RegexGenerator generator = new RegexGenerator(); 48 | for (int i = 0; i < numRows; i++) { 49 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 50 | 51 | } 52 | } catch (Exception e) { 53 | logger.error("Error in Hexcolors class " + e); 54 | } 55 | return listOfColumns; 56 | 57 | } 58 | 59 | ; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/NumberFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of Numbers having certain precision. 33 | */ 34 | public class NumberFormat implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(NumberFormat.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | 40 | String[] breaker = values.trim().split(COMMA_SPLIT); 41 | 42 | String first = String.valueOf((Integer.valueOf(breaker[0].trim()) - Integer.valueOf(breaker[1].trim()))); 43 | String regex = "^[1-9]{" + first + "}\\.[0-9]{" + breaker[1].trim() + "}$"; 44 | List resultColumn = getRegex(regex, numRows); 45 | return resultColumn; 46 | } 47 | 48 | public List getRegex(String regExPattern, int numRows) { 49 | 50 | List listOfColumns = new ArrayList(numRows); 51 | 52 | try { 53 | RegexGenerator generator = new RegexGenerator(); 54 | for (int i = 0; i < numRows; i++) { 55 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 56 | 57 | } 58 | } catch (Exception e) { 59 | logger.error("Error in NumberFormat class " + e); 60 | } 61 | return listOfColumns; 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/PanCardNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of Pan Card Numbers. 33 | */ 34 | public class PanCardNumber implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(PanCardNumber.class); 37 | 38 | 39 | public List getColumn(String values, int numRows) { 40 | 41 | return getRegex(PANCARDNUMBERREGEX, numRows); 42 | } 43 | 44 | public List getRegex(String regExPattern, int numRows) { 45 | 46 | List listOfColumns = new ArrayList(numRows); 47 | 48 | try { 49 | RegexGenerator generator = new RegexGenerator(); 50 | for (int i = 0; i < numRows; i++) { 51 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 52 | 53 | } 54 | } catch (Exception e) { 55 | logger.error("Error in PanCardNumber class " + e); 56 | } 57 | return listOfColumns; 58 | 59 | } 60 | 61 | ; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Password.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of Passwords. 33 | */ 34 | public class Password implements DataGenerator, Constants { 35 | 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(Password.class); 38 | 39 | public List getColumn(String values, int numRows) { 40 | return getRegex(PASSWORDREGEX, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | logger.error("Error in Password datatype " + e); 55 | } 56 | return listOfColumns; 57 | 58 | } 59 | 60 | ; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/PhoneNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of PhoneNumbers. 33 | */ 34 | public class PhoneNumber implements DataGenerator, Constants { 35 | 36 | private static final Logger logger = LoggerFactory.getLogger(PhoneNumber.class); 37 | 38 | public List getColumn(String values, int numRows) { 39 | 40 | return getRegex(PHONENUMBERREGEX, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | logger.error("Error in PhoneNumber datatype " + e); 55 | } 56 | return listOfColumns; 57 | 58 | } 59 | 60 | ; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/PhoneNumberWithExt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of PhoneNumberWithExt. 33 | */ 34 | public class PhoneNumberWithExt implements DataGenerator, Constants { 35 | 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(PhoneNumberWithExt.class); 38 | 39 | 40 | public List getColumn(String values, int numRows) { 41 | 42 | return getRegex(PHONENUMBERWITHEXTREGEX, numRows); 43 | } 44 | 45 | public List getRegex(String regExPattern, int numRows) { 46 | 47 | List listOfColumns = new ArrayList(numRows); 48 | 49 | try { 50 | RegexGenerator generator = new RegexGenerator(); 51 | for (int i = 0; i < numRows; i++) { 52 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 53 | 54 | } 55 | } catch (Exception e) { 56 | logger.error("Error in PhoneNumberWithExt datatype " + e); 57 | } 58 | return listOfColumns; 59 | 60 | } 61 | 62 | ; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/RCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Rconnection; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description Generates a list of values from R. 29 | */ 30 | public class RCommand implements DataGenerator { 31 | 32 | public List getColumn(String rcommand, int numRows) { 33 | List list = getValuesFromR(rcommand, numRows); 34 | return list; 35 | } 36 | 37 | private List getValuesFromR(String RCommand, int noOfRows) { 38 | Rconnection rconnection = new Rconnection(); 39 | List list = rconnection.getValuesFromR(RCommand.trim(), noOfRows); 40 | 41 | return list; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/SSN.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of SSN numbers. 33 | */ 34 | public class SSN implements DataGenerator, Constants { 35 | 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(SSN.class); 38 | 39 | public List getColumn(String values, int numRows) { 40 | 41 | return getRegex(SSNREGEX, numRows); 42 | } 43 | 44 | public List getRegex(String regExPattern, int numRows) { 45 | 46 | List listOfColumns = new ArrayList(numRows); 47 | 48 | try { 49 | RegexGenerator generator = new RegexGenerator(); 50 | for (int i = 0; i < numRows; i++) { 51 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 52 | 53 | } 54 | } catch (Exception e) { 55 | 56 | logger.error("Error in SSN datatype " + e); 57 | } 58 | return listOfColumns; 59 | 60 | } 61 | 62 | ; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/State.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.common.SpringContext; 23 | import org.datarapid.core.databuilder.DataGenerator; 24 | import org.datarapid.core.persistence.model.LocationInfo; 25 | import org.datarapid.core.persistence.transactionservice.LocationInfoService; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of states from the database. 32 | */ 33 | public class State implements DataGenerator { 34 | 35 | public List getColumn(String values, int numRows) { 36 | 37 | List list = getLocationInfoFromDB(numRows); 38 | return list; 39 | } 40 | 41 | public List getLocationInfoFromDB(int noOfValues) { 42 | 43 | LocationInfoService infoService = SpringContext.getBean("locationInfoService"); 44 | 45 | List infos = infoService.findAllLocation(); 46 | List list = new ArrayList(); 47 | 48 | int interm = noOfValues / 80000; 49 | int remains = noOfValues % 80000; 50 | 51 | if (interm == 0) { 52 | 53 | for (int j = 1; j <= noOfValues; j++) { 54 | list.add(infos.get(j).getState()); 55 | } 56 | } else { 57 | for (int m = 0; m < interm; m++) { 58 | 59 | // if we limit this number of entries from database to 5000 60 | // ,else you can change your value 61 | for (int j = 0; j < 80000; j++) { 62 | 63 | list.add(infos.get(j).getState()); 64 | 65 | } 66 | 67 | } 68 | for (int j = 0; j < remains; j++) { 69 | list.add(infos.get(j).getState()); 70 | } 71 | } 72 | return list; 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/Timestamp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.TimeStampGenerator; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description Generates a list of oracle timestamp generated between the 29 | * start-date and the end-date. 30 | */ 31 | public class Timestamp implements DataGenerator { 32 | 33 | public List getColumn(String input, int numRows) { 34 | TimeStampGenerator timeStampGenerator = new TimeStampGenerator(); 35 | List list = timeStampGenerator.generateTimestamp(input.trim(), numRows); 36 | return list; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/UniqueValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Rconnection; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description Generates a list of unique numbers between the user input range. 29 | */ 30 | public class UniqueValues implements DataGenerator { 31 | 32 | public List getColumn(String uniqueValueGeneration, int numRows) { 33 | 34 | List list = getUniqueValues(uniqueValueGeneration.trim(), numRows); 35 | return list; 36 | } 37 | 38 | private List getUniqueValues(String uniqueValueGeneration, int noOfRows) { 39 | 40 | Rconnection rconnection = new Rconnection(); 41 | List list = rconnection.createUniquekeys(uniqueValueGeneration, noOfRows); 42 | 43 | return list; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/UserDefinedRegexPattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.RegexGenerator; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | import java.util.ArrayList; 28 | import java.util.List; 29 | 30 | /** 31 | * @Description Generates a list of values from the user defined regex pattern. 32 | */ 33 | public class UserDefinedRegexPattern implements DataGenerator { 34 | 35 | private static final Logger logger = LoggerFactory.getLogger(UserDefinedRegexPattern.class); 36 | 37 | public List getColumn(String values, int numRows) { 38 | 39 | List list = getRegex(values, numRows); 40 | 41 | return list; 42 | } 43 | 44 | public List getRegex(String regExPattern, int numRows) { 45 | 46 | List listOfColumns = new ArrayList(numRows); 47 | 48 | try { 49 | RegexGenerator generator = new RegexGenerator(); 50 | for (int i = 0; i < numRows; i++) { 51 | final String regExPattern2 = "^" + regExPattern + "$"; 52 | listOfColumns.add(generator.generateFromRegex(regExPattern2).toString()); 53 | 54 | } 55 | } catch (Exception e) { 56 | logger.error("Error in UserDefiendRegexPattern datatype " + e); 57 | } 58 | return listOfColumns; 59 | 60 | } 61 | 62 | ; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/databuilder/datatypes/VisaCreditCardNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.databuilder.datatypes; 21 | 22 | import org.datarapid.core.databuilder.DataGenerator; 23 | import org.datarapid.core.util.Constants; 24 | import org.datarapid.core.util.RegexGenerator; 25 | import org.slf4j.Logger; 26 | import org.slf4j.LoggerFactory; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @Description Generates a list of visa credit card numbers. 33 | */ 34 | public class VisaCreditCardNumber implements DataGenerator, Constants { 35 | 36 | 37 | private static final Logger logger = LoggerFactory.getLogger(VisaCreditCardNumber.class); 38 | 39 | public List getColumn(String values, int numRows) { 40 | return getRegex(VISACREDITCARDNUMBER, numRows); 41 | } 42 | 43 | public List getRegex(String regExPattern, int numRows) { 44 | 45 | List listOfColumns = new ArrayList(numRows); 46 | 47 | try { 48 | RegexGenerator generator = new RegexGenerator(); 49 | for (int i = 0; i < numRows; i++) { 50 | listOfColumns.add(generator.generateFromRegex(regExPattern).toString()); 51 | 52 | } 53 | } catch (Exception e) { 54 | logger.error("Error in VisaCreditCardNumber datatype " + e); 55 | } 56 | return listOfColumns; 57 | 58 | } 59 | 60 | ; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/exception/DataGenException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.exception; 21 | 22 | public class DataGenException extends Exception { 23 | 24 | /** 25 | * The class to handle the data gen exception 26 | */ 27 | private static final long serialVersionUID = -2257497599459557110L; 28 | 29 | 30 | public DataGenException(String msg) { 31 | super(msg); 32 | } 33 | 34 | public DataGenException(String msg, Throwable e) { 35 | super(msg, e); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/configuration/AppConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.configuration; 21 | 22 | import org.springframework.context.annotation.ComponentScan; 23 | import org.springframework.context.annotation.Configuration; 24 | 25 | /** 26 | * @Description :-This class when loaded into the application context will scan 27 | * for all the classes in the base package. 28 | */ 29 | 30 | @Configuration 31 | @ComponentScan(basePackages = "org.datarapid.core") 32 | public class AppConfig { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/AbstractDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.hibernate.Session; 23 | import org.hibernate.SessionFactory; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | 26 | /** 27 | * @Description 28 | */ 29 | public abstract class AbstractDao { 30 | 31 | @Autowired 32 | private SessionFactory sessionFactory; 33 | 34 | protected Session getSession() { 35 | return sessionFactory.getCurrentSession(); 36 | } 37 | 38 | public void persist(Object entity) { 39 | getSession().persist(entity); 40 | } 41 | 42 | public void delete(Object entity) { 43 | getSession().delete(entity); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/BaseDataGeneratorDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @Description Generic interfacefor getting the list of items from the database 26 | */ 27 | public interface BaseDataGeneratorDAO { 28 | List findAllDetails(); 29 | } 30 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/BaseDataGeneratorDAOImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.springframework.stereotype.Repository; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description :-Generic DAO class to get back data from the database.Retrieves 28 | * the personal information and the location information. 29 | */ 30 | @Repository("baseDataGeneratorDAO") 31 | public class BaseDataGeneratorDAOImpl extends AbstractDao implements BaseDataGeneratorDAO { 32 | 33 | @SuppressWarnings("unchecked") 34 | public List findAllDetails() { 35 | 36 | @SuppressWarnings("rawtypes") 37 | final List personalInfo = getSession().createQuery("from PersonalInfo").list(); 38 | 39 | return (List) personalInfo; 40 | 41 | } 42 | 43 | @SuppressWarnings("unchecked") 44 | public List findAllLocations() { 45 | 46 | @SuppressWarnings("rawtypes") 47 | final List locationInfo = getSession().createQuery("from LocationInfo").list(); 48 | return (List) locationInfo; 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorActivityLogDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.ActivityLogInformation; 23 | 24 | /** 25 | * @Description Generic interface for getting the activity log from the database 26 | */ 27 | public interface DataGeneratorActivityLogDAO { 28 | 29 | boolean logActivity(ActivityLogInformation activityLogInformation); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorActivityLogDAOImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.ActivityLogInformation; 23 | import org.springframework.stereotype.Repository; 24 | 25 | /** 26 | * @Description :-Generic DAO class to get/post activity log information from the database. 27 | */ 28 | @Repository("dataGeneratorActivityLogDAO") 29 | public class DataGeneratorActivityLogDAOImpl extends AbstractDao implements DataGeneratorActivityLogDAO { 30 | 31 | public boolean logActivity(ActivityLogInformation activityLogInformation) { 32 | 33 | getSession().persist(activityLogInformation); 34 | return true; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorDataSetDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.DataSetInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description Generic interface for getting the dataset from the database 28 | */ 29 | public interface DataGeneratorDataSetDAO { 30 | 31 | List listDataSets(); 32 | 33 | List getDataSet(String fileName); 34 | 35 | boolean addDataSet(DataSetInformation dataSetInformation); 36 | 37 | boolean deleteDataSet(DataSetInformation dataSetInformation); 38 | 39 | boolean updateDataSet(DataSetInformation dataSetInformation); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorDataSetDAOImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.DataSetInformation; 23 | import org.springframework.stereotype.Repository; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description :-Generic DAO class to get/post dataset information from the database. 29 | */ 30 | @Repository("dataGeneratorDataSetDAO") 31 | public class DataGeneratorDataSetDAOImpl extends AbstractDao implements DataGeneratorDataSetDAO { 32 | 33 | @SuppressWarnings("unchecked") 34 | public List listDataSets() { 35 | 36 | final List roleInfo = getSession().createQuery("from DataSetInformation ORDER BY created_time DESC").list(); 37 | return (List) roleInfo; 38 | 39 | } 40 | 41 | public boolean addDataSet(DataSetInformation dataSetInformation) { 42 | 43 | getSession().persist(dataSetInformation); 44 | return true; 45 | } 46 | 47 | public List getDataSet(String fileName) { 48 | // TODO Auto-generated method stub 49 | @SuppressWarnings("rawtypes") 50 | final List roleInfo = getSession().createQuery("from DataSetInformation where file_name=?").setString(0, fileName).list(); 51 | return (List) roleInfo; 52 | } 53 | 54 | public boolean deleteDataSet(DataSetInformation dataSetInformation) { 55 | // TODO Auto-generated method stub 56 | getSession().delete(dataSetInformation); 57 | return true; 58 | } 59 | 60 | public boolean updateDataSet(DataSetInformation dataSetInformation) { 61 | // TODO Auto-generated method stub 62 | getSession().update(dataSetInformation); 63 | return true; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorRoleDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.RoleInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description Generic interface for getting the Roles from the database 28 | */ 29 | public interface DataGeneratorRoleDAO { 30 | 31 | List listRoles(); 32 | 33 | List getRole(String userName); 34 | 35 | boolean addRole(RoleInformation roleInformation); 36 | 37 | boolean deleteRole(RoleInformation roleInformation); 38 | 39 | boolean updateRole(RoleInformation roleInformation); 40 | 41 | boolean isRoleActive(String userName); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorUserDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.UserInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description Generic interface for getting the Users from the database 28 | */ 29 | public interface DataGeneratorUserDAO { 30 | 31 | List listUsers(); 32 | 33 | List getUser(String userName); 34 | 35 | boolean addUser(UserInformation userInformation); 36 | 37 | boolean deleteUser(UserInformation userInformation); 38 | 39 | boolean updateUser(UserInformation userInformation); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/dao/DataGeneratorUserDAOImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.dao; 21 | 22 | import org.datarapid.core.persistence.model.UserInformation; 23 | import org.springframework.stereotype.Repository; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @Description :-Generic DAO class to get/post user information from the database. 29 | */ 30 | @Repository("dataGeneratorUserDAO") 31 | public class DataGeneratorUserDAOImpl extends AbstractDao implements DataGeneratorUserDAO { 32 | 33 | @SuppressWarnings("unchecked") 34 | public List listUsers() { 35 | 36 | final List userInfo = getSession().createQuery("from UserInformation").list(); 37 | return (List) userInfo; 38 | 39 | } 40 | 41 | public boolean addUser(UserInformation userInformation) { 42 | 43 | getSession().persist(userInformation); 44 | return true; 45 | } 46 | 47 | public List getUser(String userName) { 48 | // TODO Auto-generated method stub 49 | @SuppressWarnings("rawtypes") 50 | final List userInfo = getSession().createQuery("from UserInformation where user_name=?").setString(0, userName).list(); 51 | return (List) userInfo; 52 | } 53 | 54 | public boolean deleteUser(UserInformation userInformation) { 55 | // TODO Auto-generated method stub 56 | getSession().delete(userInformation); 57 | return true; 58 | } 59 | 60 | public boolean updateUser(UserInformation userInformation) { 61 | // TODO Auto-generated method stub 62 | getSession().update(userInformation); 63 | return true; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/ActivityLogInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.model.ActivityLogInformation; 23 | 24 | /** 25 | * @Description Activity Log Info Service Interface 26 | */ 27 | 28 | public interface ActivityLogInfoService { 29 | 30 | /** 31 | * @Description To create an activity 32 | */ 33 | 34 | boolean logActivity(ActivityLogInformation activityLogInformation); 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/ActivityLogInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.dao.DataGeneratorActivityLogDAO; 23 | import org.datarapid.core.persistence.model.ActivityLogInformation; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.stereotype.Service; 26 | import org.springframework.transaction.annotation.Transactional; 27 | 28 | /** 29 | * @Description This class implements ActivityLogInfoService interface,performs the 30 | * transaction and returns the result-set. 31 | */ 32 | 33 | @Service("activityLogInfoService") 34 | @Transactional 35 | public class ActivityLogInfoServiceImpl implements ActivityLogInfoService { 36 | 37 | @Autowired 38 | private DataGeneratorActivityLogDAO dao; 39 | 40 | /** 41 | * @Description To create an activity log entry 42 | */ 43 | public boolean logActivity(ActivityLogInformation activityLogInformation) { 44 | 45 | return dao.logActivity(activityLogInformation); 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/DataSetInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.model.DataSetInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description User Info Service Interface 28 | */ 29 | 30 | public interface DataSetInfoService { 31 | 32 | /** 33 | * @Description To retrieve all the datasets 34 | */ 35 | 36 | List listDataSets(); 37 | 38 | /** 39 | * @Description To add a dataset 40 | */ 41 | 42 | boolean addDataSet(DataSetInformation dataSetInformation); 43 | 44 | /** 45 | * @Description To retrieve a specific dataset 46 | */ 47 | 48 | List getDataSet(String fileName); 49 | 50 | /** 51 | * @Description To delete the dataset 52 | */ 53 | 54 | boolean deleteDataSet(DataSetInformation dataSetInformation); 55 | 56 | 57 | /** 58 | * @Description To update a dataset 59 | */ 60 | 61 | boolean updateDataSet(DataSetInformation dataSetInformation); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/LocationInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | /** 22 | * @Description Location info interface 23 | */ 24 | 25 | import org.datarapid.core.persistence.model.LocationInfo; 26 | 27 | import java.util.List; 28 | 29 | public interface LocationInfoService { 30 | 31 | List findAllLocation(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/LocationInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | /** 22 | * @Description This class implements LocationInfoService interface,performs the transaction and returns the result-set. 23 | */ 24 | 25 | import org.datarapid.core.persistence.dao.BaseDataGeneratorDAOImpl; 26 | import org.datarapid.core.persistence.model.LocationInfo; 27 | import org.slf4j.Logger; 28 | import org.slf4j.LoggerFactory; 29 | import org.springframework.beans.factory.annotation.Autowired; 30 | import org.springframework.stereotype.Service; 31 | import org.springframework.transaction.annotation.Transactional; 32 | 33 | import java.util.List; 34 | 35 | @Service("locationInfoService") 36 | @Transactional 37 | public class LocationInfoServiceImpl implements LocationInfoService { 38 | 39 | @Autowired 40 | private BaseDataGeneratorDAOImpl dao; 41 | 42 | final static Logger logger = LoggerFactory.getLogger(LocationInfoServiceImpl.class); 43 | 44 | public List findAllLocation() { 45 | return dao.findAllLocations(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/PersonalInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.model.PersonalInfo; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description 28 | */ 29 | 30 | public interface PersonalInfoService { 31 | 32 | List findAllDetails(); 33 | } 34 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/PersonalInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.dao.BaseDataGeneratorDAO; 23 | import org.datarapid.core.persistence.model.PersonalInfo; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.stereotype.Service; 26 | import org.springframework.transaction.annotation.Transactional; 27 | 28 | import java.util.List; 29 | 30 | /** 31 | * @Description This class implements PersonalInfoService interface,performs the 32 | * transaction and returns the result-set. 33 | */ 34 | 35 | @Service("personalInfoService") 36 | @Transactional 37 | public class PersonalInfoServiceImpl implements PersonalInfoService { 38 | 39 | @Autowired 40 | private BaseDataGeneratorDAO dao; 41 | 42 | public List findAllDetails() { 43 | // TODO Auto-generated method stub 44 | return dao.findAllDetails(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/RoleInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.model.RoleInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description Role Info Service Interface 28 | */ 29 | 30 | public interface RoleInfoService { 31 | 32 | /** 33 | * @Description To retrieve all the roles 34 | */ 35 | 36 | List listRoles(); 37 | 38 | /** 39 | * @Description To add a role 40 | */ 41 | 42 | boolean addRole(RoleInformation roleInformation); 43 | 44 | /** 45 | * @Description To retrieve a specific role 46 | */ 47 | 48 | List getRole(String userName); 49 | 50 | /** 51 | * @Description To delete the role 52 | */ 53 | 54 | boolean deleteRole(RoleInformation roleInformation); 55 | 56 | 57 | /** 58 | * @Description To update an role 59 | */ 60 | 61 | boolean updateRole(RoleInformation roleInformation); 62 | 63 | 64 | /** 65 | * @Description checking whether the role is active or not 66 | */ 67 | 68 | boolean isRoleActive(String userName); 69 | 70 | } 71 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/RoleInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.dao.DataGeneratorRoleDAO; 23 | import org.datarapid.core.persistence.model.RoleInformation; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.stereotype.Service; 26 | import org.springframework.transaction.annotation.Transactional; 27 | 28 | import java.util.List; 29 | 30 | /** 31 | * @Description This class implements RoleInfoService interface,performs the 32 | * transaction and returns the result-set. 33 | */ 34 | 35 | @Service("roleInfoService") 36 | @Transactional 37 | public class RoleInfoServiceImpl implements RoleInfoService { 38 | 39 | @Autowired 40 | private DataGeneratorRoleDAO dao; 41 | 42 | /** 43 | * @Description To retrieve all the roles 44 | */ 45 | public List listRoles() { 46 | 47 | return dao.listRoles(); 48 | 49 | } 50 | 51 | /** 52 | * @Description To add a role 53 | */ 54 | public boolean addRole(RoleInformation roleInformation) { 55 | 56 | return dao.addRole(roleInformation); 57 | 58 | } 59 | 60 | /** 61 | * @Description To retrieve a specific role 62 | */ 63 | public List getRole(String userName) { 64 | 65 | return dao.getRole(userName); 66 | 67 | } 68 | 69 | /** 70 | * @Description To delete the role 71 | */ 72 | public boolean deleteRole(RoleInformation roleInformation) { 73 | 74 | return dao.deleteRole(roleInformation); 75 | 76 | } 77 | 78 | 79 | /** 80 | * @Description To update an role 81 | */ 82 | public boolean updateRole(RoleInformation roleInformation) { 83 | 84 | return dao.updateRole(roleInformation); 85 | 86 | } 87 | 88 | 89 | /** 90 | * @Description checking whether the role is active or not 91 | */ 92 | public boolean isRoleActive(String userName) { 93 | 94 | return dao.isRoleActive(userName); 95 | 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/UserInfoService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.model.UserInformation; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @Description User Info Service Interface 28 | */ 29 | 30 | public interface UserInfoService { 31 | 32 | /** 33 | * @Description To retrieve all the users 34 | */ 35 | 36 | List listUsers(); 37 | 38 | /** 39 | * @Description To add a user 40 | */ 41 | 42 | boolean addUser(UserInformation userInformation); 43 | 44 | /** 45 | * @Description To retrieve a specific user 46 | */ 47 | 48 | List getUser(String userName); 49 | 50 | /** 51 | * @Description To delete the user 52 | */ 53 | 54 | boolean deleteUser(UserInformation userInformation); 55 | 56 | 57 | /** 58 | * @Description To update an user 59 | */ 60 | 61 | boolean updateUser(UserInformation userInformation); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/persistence/transactionservice/UserInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.persistence.transactionservice; 21 | 22 | import org.datarapid.core.persistence.dao.DataGeneratorUserDAO; 23 | import org.datarapid.core.persistence.model.UserInformation; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.stereotype.Service; 26 | import org.springframework.transaction.annotation.Transactional; 27 | 28 | import java.util.List; 29 | 30 | /** 31 | * @Description This class implements UserInfoService interface,performs the 32 | * transaction and returns the result-set. 33 | */ 34 | 35 | @Service("userInfoService") 36 | @Transactional 37 | public class UserInfoServiceImpl implements UserInfoService { 38 | 39 | @Autowired 40 | private DataGeneratorUserDAO dao; 41 | 42 | /** 43 | * @Description To retrieve all the users 44 | */ 45 | public List listUsers() { 46 | 47 | return dao.listUsers(); 48 | 49 | } 50 | 51 | /** 52 | * @Description To add a user 53 | */ 54 | public boolean addUser(UserInformation userInformation) { 55 | 56 | return dao.addUser(userInformation); 57 | 58 | } 59 | 60 | /** 61 | * @Description To retrieve a specific user 62 | */ 63 | public List getUser(String userName) { 64 | 65 | return dao.getUser(userName); 66 | 67 | } 68 | 69 | /** 70 | * @Description To delete the user 71 | */ 72 | public boolean deleteUser(UserInformation userInformation) { 73 | 74 | return dao.deleteUser(userInformation); 75 | 76 | } 77 | 78 | 79 | /** 80 | * @Description To update an user 81 | */ 82 | public boolean updateUser(UserInformation userInformation) { 83 | 84 | return dao.updateUser(userInformation); 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/util/IntegerAndFloatRangeGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.util; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | import java.util.Random; 26 | 27 | /** 28 | * @Description This class will generate the random values from the user given 29 | * set.It also generates the random integer and float range from 30 | * the given range. 31 | */ 32 | public class IntegerAndFloatRangeGenerator { 33 | 34 | private static final Logger logger = LoggerFactory.getLogger(IntegerAndFloatRangeGenerator.class); 35 | private static final Random rand = new Random(); 36 | 37 | /** 38 | * @param integerRange 39 | * @Description This method generates the random integer between the range 40 | * given from the user. The user should give the input in the 41 | * format "startValue to endValue". 42 | */ 43 | public String generateRandomInteger(String integerRange) { 44 | try { 45 | String[] arg = integerRange.split("to"); 46 | int min = Integer.valueOf(arg[0].trim()); 47 | int max = Integer.valueOf(arg[1].trim()); 48 | int a = min + (int) (Math.random() * ((max - min) + 1)); 49 | return String.valueOf(a); 50 | } catch (NumberFormatException e) { 51 | logger.error("Error in the input pattern for the Random Integer generation " + e); 52 | } 53 | return null; 54 | 55 | } 56 | 57 | /** 58 | * @param floatRange 59 | * @Description This method generates the random float values between the 60 | * range given from the user. The user should give the input in 61 | * the format "startValue to endValue". 62 | */ 63 | public String generateRandomFloat(String floatRange) { 64 | 65 | try { 66 | String[] arg = floatRange.split("to"); 67 | float min = Integer.valueOf(arg[0].trim()); 68 | float max = Integer.valueOf(arg[1].trim()); 69 | float finalX = rand.nextFloat() * (max - min) + min; 70 | return String.valueOf(finalX); 71 | 72 | } catch (NumberFormatException e) { 73 | logger.error("Error in the input pattern for the Random float generation " + e); 74 | } 75 | return null; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/util/PropertyUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.util; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | import java.util.Properties; 28 | 29 | /** 30 | * Property Util 31 | */ 32 | public class PropertyUtil { 33 | 34 | private static final Logger log = LoggerFactory.getLogger(PropertyUtil.class); 35 | 36 | /** 37 | * Loading contents from the file into a {@link java.util.Properties} 38 | * 39 | * @param fileName 40 | * @return 41 | * @throws IOException 42 | */ 43 | public Properties loadPropertyFromClasspath(String fileName) throws IOException { 44 | Properties properties = new Properties(); 45 | InputStream stream = this.getClass().getClassLoader().getResourceAsStream(fileName); 46 | if (null == stream) { 47 | log.error("{} is not available in classpath", fileName); 48 | throw new IOException(fileName + " is not available in classpath"); 49 | } 50 | properties.load(stream); 51 | return properties; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/util/RegexGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.util; 21 | 22 | import java.util.Random; 23 | import java.util.regex.Matcher; 24 | import java.util.regex.Pattern; 25 | 26 | /** 27 | * @Description This class generates the data from the input regex pattern. 28 | */ 29 | public class RegexGenerator { 30 | 31 | public StringBuilder generateFromRegex(String regex) { 32 | Random random = new Random(); 33 | StringBuilder b = new StringBuilder(); 34 | 35 | Pattern p = Pattern.compile(regex); 36 | Matcher m = p.matcher(""); 37 | 38 | int[] cypher = new int[95]; 39 | boolean done = false; 40 | 41 | // start from an empty string and grow a solution 42 | while (!done) { 43 | // make a cypher to jumble the order letters are tried 44 | for (int i = 0; i < 95; i++) { 45 | cypher[i] = i; 46 | } 47 | 48 | for (int i = 0; i < 95; i++) { 49 | int n = random.nextInt(95 - i) + i; 50 | 51 | int t = cypher[n]; 52 | cypher[n] = cypher[i]; 53 | cypher[i] = t; 54 | } 55 | 56 | // try and grow partial solution using an extra letter on the end 57 | for (int i = 0; i < 95; i++) { 58 | int n = cypher[i] + 32; 59 | b.append((char) n); 60 | 61 | String result = b.toString(); 62 | m.reset(result); 63 | if (m.matches()) { // complete solution found 64 | // don't try to expand to a larger solution 65 | if (!random.nextBoolean()) { 66 | done = true; 67 | } 68 | 69 | break; 70 | } else if (m.hitEnd()) { // prefix to a solution found, keep 71 | // this letter 72 | break; 73 | } else { // dead end found, try a new character at the end 74 | b.deleteCharAt(b.length() - 1); 75 | 76 | // no more possible characters to try and expand with - stop 77 | if (i == 94) { 78 | done = true; 79 | } 80 | } 81 | } 82 | } 83 | return new StringBuilder(b.toString()); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/util/TimeStampGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.util; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | import java.sql.Timestamp; 26 | import java.text.ParseException; 27 | import java.text.SimpleDateFormat; 28 | import java.util.ArrayList; 29 | import java.util.Date; 30 | import java.util.List; 31 | 32 | /** 33 | * @Description The user can give the date range in the format 34 | * "StartDate-EndDate#outputSimpleDateFormat". 35 | * The user will get the oracle timestamp between the two 36 | * given dates. 37 | */ 38 | public class TimeStampGenerator implements Constants { 39 | 40 | private static final Logger logger = LoggerFactory.getLogger(TimeStampGenerator.class); 41 | 42 | /** 43 | * @param inputFromUser,noOfRows 44 | * @Description This method is called from the Timestamp class.It receives 45 | * the number of rows and String input which contains 46 | * information of the startDate and the endDate.It separates 47 | * the input field into the start date and end date.It then 48 | * populates the list with random oracle timestamp generated 49 | * between the two dates. 50 | */ 51 | public List generateTimestamp(String inputFromUser, int noOfRows) { 52 | 53 | String[] separator = inputFromUser.split("#"); 54 | String format = separator[1].trim(); 55 | // date format from the user 56 | SimpleDateFormat outputFormat = new SimpleDateFormat(format); 57 | String date = separator[0].trim(); 58 | String[] dateBreaker = date.split("to"); 59 | List list = new ArrayList(); 60 | if (dateBreaker.length == 2) { 61 | try { 62 | Date fromDate = outputFormat.parse(dateBreaker[0]); 63 | Date toDate = outputFormat.parse(dateBreaker[1]); 64 | long startDate = fromDate.getTime(); 65 | long endDate = toDate.getTime(); 66 | long diff = endDate - startDate + 1; 67 | for (int i = 0; i < noOfRows; i++) { 68 | Timestamp rand = new Timestamp(startDate + (long) (Math.random() * diff)); 69 | list.add(String.valueOf(rand.getTime())); 70 | } 71 | } catch (ParseException e) { 72 | logger.error("Error in TimeStampGenerator datatype " + e); 73 | } 74 | } 75 | return list; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/BucketedColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.io.Serializable; 23 | import java.util.List; 24 | 25 | /** 26 | * @Description :- This class contains information about the column to be 27 | * bucketed.It contains fields such as bucketedColumnHeader, 28 | * and list of columnMapper. 29 | */ 30 | public class BucketedColumn implements Serializable { 31 | 32 | private String bucketedColumnHeader; 33 | private List columnMapper; 34 | 35 | public BucketedColumn() { 36 | // TODO Auto-generated constructor stub 37 | } 38 | 39 | /** 40 | * @return the bucketedColumnHeader 41 | */ 42 | public String getBucketedColumnHeader() { 43 | return bucketedColumnHeader; 44 | } 45 | 46 | /** 47 | * @param bucketedColumnHeader the bucketedColumnHeader to set 48 | */ 49 | public void setBucketedColumnHeader(String bucketedColumnHeader) { 50 | this.bucketedColumnHeader = bucketedColumnHeader; 51 | } 52 | 53 | /** 54 | * @return the columnMapper 55 | */ 56 | public List getColumnMapper() { 57 | return columnMapper; 58 | } 59 | 60 | /** 61 | * @param columnMapper the columnMapper to set 62 | */ 63 | public void setColumnMapper(List columnMapper) { 64 | this.columnMapper = columnMapper; 65 | } 66 | 67 | public BucketedColumn(String bucketedColumnHeader, List columnMapper) { 68 | super(); 69 | this.bucketedColumnHeader = bucketedColumnHeader; 70 | this.columnMapper = columnMapper; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/DataSetConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | /** 23 | * @Description :- Contains all the dataset information 24 | */ 25 | public class DataSetConfiguration { 26 | 27 | private int configId; 28 | private String fileName; 29 | private String fileType; 30 | private String userName; 31 | private String createdTime; 32 | private JobConfiguration jobConfiguration; 33 | 34 | public int getConfigId() { 35 | return configId; 36 | } 37 | 38 | public void setConfigId(int configId) { 39 | this.configId = configId; 40 | } 41 | 42 | /** 43 | * @return the fileName 44 | */ 45 | public String getFileName() { 46 | return fileName; 47 | } 48 | 49 | /** 50 | * @param fileName the fileName to set 51 | */ 52 | public void setFileName(String fileName) { 53 | this.fileName = fileName; 54 | } 55 | 56 | /** 57 | * @return the fileType 58 | */ 59 | public String getFileType() { 60 | return fileType; 61 | } 62 | 63 | /** 64 | * @param fileType the fileType to set 65 | */ 66 | public void setFileType(String fileType) { 67 | this.fileType = fileType; 68 | } 69 | 70 | /** 71 | * @return the userName 72 | */ 73 | public String getUserName() { 74 | return userName; 75 | } 76 | 77 | /** 78 | * @param userName the userName to set 79 | */ 80 | public void setUserName(String userName) { 81 | this.userName = userName; 82 | } 83 | 84 | /** 85 | * @return the createdTime 86 | */ 87 | public String getCreatedTime() { 88 | return createdTime; 89 | } 90 | 91 | /** 92 | * @param createdTime the createdTime to set 93 | */ 94 | public void setCreatedTime(String createdTime) { 95 | this.createdTime = createdTime; 96 | } 97 | 98 | /** 99 | * @return the jobConfiguration 100 | */ 101 | public JobConfiguration getJobConfiguration() { 102 | return jobConfiguration; 103 | } 104 | 105 | /** 106 | * @param jobConfiguration the jobConfiguration to set 107 | */ 108 | public void setJobConfiguration(JobConfiguration jobConfiguration) { 109 | this.jobConfiguration = jobConfiguration; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/DataSetConfigurations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @Description :- Contains all the dataset information 26 | */ 27 | public class DataSetConfigurations { 28 | 29 | private List dataSetConfigurations; 30 | 31 | /** 32 | * @return the dataSetConfigurations 33 | */ 34 | public List getDataSetConfigurations() { 35 | return dataSetConfigurations; 36 | } 37 | 38 | /** 39 | * @param dataSetConfigurations the dataSetConfigurations to set 40 | */ 41 | public void setDataSetConfigurations(List dataSetConfigurations) { 42 | this.dataSetConfigurations = dataSetConfigurations; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/FileInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.io.Serializable; 23 | import java.util.List; 24 | 25 | /** 26 | * @Description :-Contains the List which contains information for 27 | * individual columns such as data-type,values,column name and so 28 | * on . 29 | */ 30 | public class FileInfo implements Serializable { 31 | 32 | public FileInfo() { 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | private List listOfColumns; 37 | 38 | public FileInfo(List listOfColumns) { 39 | 40 | this.listOfColumns = listOfColumns; 41 | } 42 | 43 | /** 44 | * @return the listOfColumns 45 | */ 46 | public List getListOfColumns() { 47 | return listOfColumns; 48 | } 49 | 50 | /** 51 | * @param listOfColumns the listOfColumns to set 52 | */ 53 | public void setListOfColumns(List listOfColumns) { 54 | this.listOfColumns = listOfColumns; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/JobConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.io.Serializable; 23 | 24 | /** 25 | * @Description :- Contains all the file information such as 26 | * fileName,numberOfRows,fileType and FileInfo object. 27 | */ 28 | public class JobConfiguration implements Serializable { 29 | 30 | private int configId; 31 | private String fileName; 32 | private FileInfo fileInfo; 33 | private String numberOfRows; 34 | private String fileType; 35 | 36 | public JobConfiguration() { 37 | // TODO Auto-generated constructor stub 38 | } 39 | 40 | public int getConfigId() { 41 | return configId; 42 | } 43 | 44 | public void setConfigId(int configId) { 45 | this.configId = configId; 46 | } 47 | 48 | /** 49 | * @return the fileName 50 | */ 51 | public String getFileName() { 52 | return fileName; 53 | } 54 | 55 | /** 56 | * @param fileName the fileName to set 57 | */ 58 | public void setFileName(String fileName) { 59 | this.fileName = fileName; 60 | } 61 | 62 | /** 63 | * @return the fileInfo 64 | */ 65 | public FileInfo getFileInfo() { 66 | return fileInfo; 67 | } 68 | 69 | /** 70 | * @param fileInfo the fileInfo to set 71 | */ 72 | public void setFileInfo(FileInfo fileInfo) { 73 | this.fileInfo = fileInfo; 74 | } 75 | 76 | /** 77 | * @return the numberOfRows 78 | */ 79 | public String getNumberOfRows() { 80 | return numberOfRows; 81 | } 82 | 83 | /** 84 | * @param numberOfRows the numberOfRows to set 85 | */ 86 | public void setNumberOfRows(String numberOfRows) { 87 | this.numberOfRows = numberOfRows; 88 | } 89 | 90 | /** 91 | * @return the fileType 92 | */ 93 | public String getFileType() { 94 | return fileType; 95 | } 96 | 97 | /** 98 | * @param fileType the fileType to set 99 | */ 100 | public void setFileType(String fileType) { 101 | this.fileType = fileType; 102 | } 103 | 104 | public JobConfiguration(String fileName, FileInfo fileInfo, String numberOfRows, String fileType) { 105 | super(); 106 | this.fileName = fileName; 107 | this.fileInfo = fileInfo; 108 | this.numberOfRows = numberOfRows; 109 | this.fileType = fileType; 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/RoleConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | /** 23 | * @Description :- Contains all the role information 24 | */ 25 | public class RoleConfiguration { 26 | 27 | 28 | private RoleInfo roleInfo; 29 | 30 | public RoleConfiguration() { 31 | // TODO Auto-generated constructor stub 32 | } 33 | 34 | /** 35 | * @return the roleInfo 36 | */ 37 | public RoleInfo getRoleInfo() { 38 | return roleInfo; 39 | } 40 | 41 | /** 42 | * @param roleInfo the roleInfo to set 43 | */ 44 | public void setRoleInfo(RoleInfo roleInfo) { 45 | this.roleInfo = roleInfo; 46 | } 47 | 48 | public RoleConfiguration(RoleInfo roleInfo) { 49 | super(); 50 | this.roleInfo = roleInfo; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/RoleInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.util.List; 23 | 24 | 25 | /** 26 | * @Description :- This class contains information about the role. 27 | * It contains fields such as role meta 28 | */ 29 | public class RoleInfo { 30 | 31 | private List roleMeta; 32 | 33 | public RoleInfo() { 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | /** 38 | * @return the roleMeta 39 | */ 40 | public List getRoleMeta() { 41 | return roleMeta; 42 | } 43 | 44 | /** 45 | * @param roleMeta the roleMeta to set 46 | */ 47 | public void setRoleMeta(List roleMeta) { 48 | this.roleMeta = roleMeta; 49 | } 50 | 51 | public RoleInfo(String userName, List roleMeta) { 52 | super(); 53 | this.roleMeta = roleMeta; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/UIColumnMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | /** 23 | * @Description:-Contains information of each column to be generated.Contains 24 | * columnName,type,valueType,dataType,values and BucketedColumn 25 | * object. 26 | */ 27 | public class UIColumnMeta { 28 | 29 | private String dataTypeName; 30 | private String dataLimit; 31 | 32 | public UIColumnMeta() { 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | public String getDataTypeName() { 37 | return dataTypeName; 38 | } 39 | 40 | public void setDataTypeName(String dataTypeName) { 41 | this.dataTypeName = dataTypeName; 42 | } 43 | 44 | public String getDataLimit() { 45 | return dataLimit; 46 | } 47 | 48 | public void setDataLimit(String dataLimit) { 49 | this.dataLimit = dataLimit; 50 | } 51 | 52 | public UIColumnMeta(String dataTypeName, String dataLimit) { 53 | super(); 54 | this.dataTypeName = dataTypeName; 55 | this.dataLimit = dataLimit; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/UIConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | /** 23 | * @Description :- Contains all the file information such as 24 | * fileName,numberOfRows,fileType and FileInfo object. 25 | */ 26 | public class UIConfiguration { 27 | 28 | private String dataTypeName; 29 | private String dataLimit; 30 | private UIFileInfo uiFileInfo; 31 | 32 | public UIConfiguration() { 33 | // TODO Auto-generated constructor stub 34 | } 35 | 36 | /** 37 | * @return the dataTypeName 38 | */ 39 | public String getDataTypeName() { 40 | return dataTypeName; 41 | } 42 | 43 | /** 44 | * @param dataTypeName the dataTypeName to set 45 | */ 46 | public void setDataTypeName(String dataTypeName) { 47 | this.dataTypeName = dataTypeName; 48 | } 49 | 50 | /** 51 | * @return the dataLimit 52 | */ 53 | public String getDataLimit() { 54 | return dataLimit; 55 | } 56 | 57 | /** 58 | * @param dataLimit the dataLimit to set 59 | */ 60 | public void setDataLimit(String dataLimit) { 61 | this.dataLimit = dataLimit; 62 | } 63 | 64 | public UIFileInfo getUiFileInfo() { 65 | return uiFileInfo; 66 | } 67 | 68 | public void setUiFileInfo(UIFileInfo uiFileInfo) { 69 | this.uiFileInfo = uiFileInfo; 70 | } 71 | 72 | public UIConfiguration(String dataTypeName, String dataLimit, UIFileInfo uiFileInfo) { 73 | super(); 74 | this.dataTypeName = dataTypeName; 75 | this.dataLimit = dataLimit; 76 | this.uiFileInfo = uiFileInfo; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/UIFileInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @Description :-Contains the List which contains information for 26 | * individual columns such as data-type,values,column name and so 27 | * on . 28 | */ 29 | public class UIFileInfo { 30 | 31 | public UIFileInfo() { 32 | // TODO Auto-generated constructor stub 33 | } 34 | 35 | private List listOfColumns; 36 | 37 | public UIFileInfo(List listOfColumns) { 38 | 39 | this.listOfColumns = listOfColumns; 40 | } 41 | 42 | /** 43 | * @return the listOfColumns 44 | */ 45 | public List getListOfColumns() { 46 | return listOfColumns; 47 | } 48 | 49 | /** 50 | * @param listOfColumns the listOfColumns to set 51 | */ 52 | public void setListOfColumns(List listOfColumns) { 53 | this.listOfColumns = listOfColumns; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/UserConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | /** 23 | * @Description :- Contains all the user information 24 | */ 25 | public class UserConfiguration { 26 | 27 | 28 | private UserInfo userInfo; 29 | 30 | public UserConfiguration() { 31 | // TODO Auto-generated constructor stub 32 | } 33 | 34 | /** 35 | * @return the userInfo 36 | */ 37 | public UserInfo getUserInfo() { 38 | return userInfo; 39 | } 40 | 41 | /** 42 | * @param userInfo the userInfo to set 43 | */ 44 | public void setUserInfo(UserInfo userInfo) { 45 | this.userInfo = userInfo; 46 | } 47 | 48 | public UserConfiguration(UserInfo userInfo) { 49 | super(); 50 | this.userInfo = userInfo; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /datarapid-core/src/main/java/org/datarapid/core/view/UserInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Infosys Ltd. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.datarapid.core.view; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @Description :-Contains the UserInformation . 26 | */ 27 | public class UserInfo { 28 | 29 | public UserInfo() { 30 | // TODO Auto-generated constructor stub 31 | } 32 | 33 | private List userMeta; 34 | 35 | /** 36 | * @param userMeta 37 | */ 38 | public UserInfo(List userMeta) { 39 | super(); 40 | this.userMeta = userMeta; 41 | } 42 | 43 | /** 44 | * @return the userMeta 45 | */ 46 | public List getUserMeta() { 47 | return userMeta; 48 | } 49 | 50 | /** 51 | * @param userMeta the userMeta to set 52 | */ 53 | public void setUserMeta(List userMeta) { 54 | this.userMeta = userMeta; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /datarapid-core/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 24 | 25 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 26 | 27 | 28 | 29 | 30 | 31 | 32 | datarapidtrace.log 33 | 34 | %date|%level|%thread|%logger{30}|%msg%n 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /datarapid-core/src/test/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /datarapid-docs/usage/Data Rapid Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/datarapid-docs/usage/Data Rapid Manual.pdf -------------------------------------------------------------------------------- /landing.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Infosys/data-rapid/8c66b7fd620ffe162d120870e4896292784253c9/landing.PNG --------------------------------------------------------------------------------