http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/modules/registry/registry-core/src/test/java/org/apache/airavata/data/catalog/util/Initialize.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/data/catalog/util/Initialize.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/data/catalog/util/Initialize.java deleted file mode 100644 index 002e51e..0000000 --- a/modules/registry/registry-core/src/test/java/org/apache/airavata/data/catalog/util/Initialize.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.airavata.data.catalog.util; - -import org.apache.airavata.common.exception.ApplicationSettingsException; -import org.apache.airavata.common.utils.ServerSettings; -import org.apache.airavata.registry.core.data.catalog.utils.DataCatalogConstants; -import org.apache.derby.drda.NetworkServerControl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.InetAddress; -import java.net.URI; -import java.sql.*; -import java.util.StringTokenizer; - -public class Initialize { - private static final Logger logger = LoggerFactory.getLogger(Initialize.class); - public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer"; - public String scriptName = "datacatalog-derby.sql"; - private NetworkServerControl server; - private static final String delimiter = ";"; - private String jdbcUrl = null; - private String jdbcDriver = null; - private String jdbcUser = null; - private String jdbcPassword = null; - - public Initialize(String scriptName) { - this.scriptName = scriptName; - } - - public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) { - if (suffix.length() > buffer.length()) { - return false; - } - // this loop is done on purpose to avoid memory allocation performance - // problems on various JDKs - // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and - // implementation is ok though does allocation/copying - // StringBuffer.toString().endsWith() does massive memory - // allocation/copying on JDK 1.5 - // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169 - int endIndex = suffix.length() - 1; - int bufferIndex = buffer.length() - 1; - while (endIndex >= 0) { - if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) { - return false; - } - bufferIndex--; - endIndex--; - } - return true; - } - - private static boolean isServerStarted(NetworkServerControl server, int ntries) - { - for (int i = 1; i <= ntries; i ++) - { - try { - Thread.sleep(500); - server.ping(); - return true; - } - catch (Exception e) { - if (i == ntries) - return false; - } - } - return false; - } - - public void initializeDB() { - try{ - jdbcDriver = ServerSettings.getSetting("datacatalog.jdbc.driver"); - jdbcUrl = ServerSettings.getSetting("datacatalog.jdbc.url"); - jdbcUser = ServerSettings.getSetting("datacatalog.jdbc.user"); - jdbcPassword = ServerSettings.getSetting("datacatalog.jdbc.password"); - jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword; - } catch (ApplicationSettingsException e) { - logger.error("Unable to read properties", e); - } - - startDerbyInServerMode(); - if(!isServerStarted(server, 20)){ - throw new RuntimeException("Derby server could not started within five seconds..."); - } - Connection conn = null; - try { - Class.forName(jdbcDriver).newInstance(); - conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword); - if (!isDatabaseStructureCreated(DataCatalogConstants.CONFIGURATION, conn)) { - executeSQLScript(conn); - logger.info("New Database created for Data Catalog !!!"); - } else { - logger.debug("Database already created for Data Catalog!"); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new RuntimeException("Database failure", e); - } finally { - try { - if (conn != null){ - if (!conn.getAutoCommit()) { - conn.commit(); - } - conn.close(); - } - } catch (SQLException e) { - logger.error(e.getMessage(), e); - } - } - } - - public static boolean isDatabaseStructureCreated(String tableName, Connection conn) { - try { - System.out.println("Running a query to test the database tables existence."); - // check whether the tables are already created with a query - Statement statement = null; - try { - statement = conn.createStatement(); - ResultSet rs = statement.executeQuery("select * from " + tableName); - if (rs != null) { - rs.close(); - } - } finally { - try { - if (statement != null) { - statement.close(); - } - } catch (SQLException e) { - return false; - } - } - } catch (SQLException e) { - return false; - } - - return true; - } - - private void executeSQLScript(Connection conn) throws Exception { - StringBuffer sql = new StringBuffer(); - BufferedReader reader = null; - try{ - - InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName); - reader = new BufferedReader(new InputStreamReader(inputStream)); - String line; - while ((line = reader.readLine()) != null) { - line = line.trim(); - if (line.startsWith("//")) { - continue; - } - if (line.startsWith("--")) { - continue; - } - StringTokenizer st = new StringTokenizer(line); - if (st.hasMoreTokens()) { - String token = st.nextToken(); - if ("REM".equalsIgnoreCase(token)) { - continue; - } - } - sql.append(" ").append(line); - - // SQL defines "--" as a comment to EOL - // and in Oracle it may contain a hint - // so we cannot just remove it, instead we must end it - if (line.indexOf("--") >= 0) { - sql.append("\n"); - } - if ((checkStringBufferEndsWith(sql, delimiter))) { - executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn); - sql.replace(0, sql.length(), ""); - } - } - // Catch any statements not followed by ; - if (sql.length() > 0) { - executeSQL(sql.toString(), conn); - } - }catch (IOException e){ - logger.error("Error occurred while executing SQL script for creating Airavata Data Catalog database", e); - throw new Exception("Error occurred while executing SQL script for creating Airavata Data Catalog database", e); - }finally { - if (reader != null) { - reader.close(); - } - } - } - - private static void executeSQL(String sql, Connection conn) throws Exception { - // Check and ignore empty statements - if ("".equals(sql.trim())) { - return; - } - - Statement statement = null; - try { - logger.debug("SQL : " + sql); - - boolean ret; - int updateCount = 0, updateCountTotal = 0; - statement = conn.createStatement(); - ret = statement.execute(sql); - updateCount = statement.getUpdateCount(); - do { - if (!ret) { - if (updateCount != -1) { - updateCountTotal += updateCount; - } - } - ret = statement.getMoreResults(); - if (ret) { - updateCount = statement.getUpdateCount(); - } - } while (ret); - - logger.debug(sql + " : " + updateCountTotal + " rows affected"); - - SQLWarning warning = conn.getWarnings(); - while (warning != null) { - logger.warn(warning + " sql warning"); - warning = warning.getNextWarning(); - } - conn.clearWarnings(); - } catch (SQLException e) { - if (e.getSQLState().equals("X0Y32")) { - // eliminating the table already exception for the derby - // database - logger.info("Table Already Exists", e); - } else { - throw new Exception("Error occurred while executing : " + sql, e); - } - } finally { - if (statement != null) { - try { - statement.close(); - } catch (SQLException e) { - logger.error("Error occurred while closing result set.", e); - } - } - } - } - - private void startDerbyInServerMode() { - try { - System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true"); - server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"), - 20000, - jdbcUser, jdbcPassword); - java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true); - server.start(consoleWriter); - } catch (IOException e) { - logger.error("Unable to start Apache derby in the server mode! Check whether " + - "specified port is available"); - } catch (Exception e) { - logger.error("Unable to start Apache derby in the server mode! Check whether " + - "specified port is available"); - } - - } - - public static int getPort(String jdbcURL){ - try{ - String cleanURI = jdbcURL.substring(5); - URI uri = URI.create(cleanURI); - return uri.getPort(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return -1; - } - } - - private void startDerbyInEmbeddedMode(){ - try { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); - DriverManager.getConnection("jdbc:derby:memory:unit-testing-jpa;create=true").close(); - } catch (ClassNotFoundException e) { - logger.error(e.getMessage(), e); - } catch (SQLException e) { - logger.error(e.getMessage(), e); - } - } - - public void stopDerbyServer() { - try { - server.shutdown(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } -}
http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalog.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalog.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalog.java deleted file mode 100644 index a2e1c9a..0000000 --- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalog.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.airavata.registry.cpi; - -import org.apache.airavata.model.data.resource.*; - -import java.util.List; - -public interface DataCatalog { - - String registerResource(DataResourceModel resource) throws DataCatalogException; - - boolean removeResource(String resourceId) throws DataCatalogException; - - boolean updateResource(DataResourceModel resource) throws DataCatalogException; - - DataResourceModel getResource(String resourceId) throws DataCatalogException; - - String registerReplicaLocation(DataReplicaLocationModel dataReplicaLocationModel) throws DataCatalogException; - - boolean removeReplicaLocation(String replicaId) throws DataCatalogException; - - boolean updateReplicaLocation(DataReplicaLocationModel dataReplicaLocationModel) throws DataCatalogException; - - DataReplicaLocationModel getReplicaLocation(String replicaId) throws DataCatalogException; - - List<DataReplicaLocationModel> getAllReplicaLocations(String resourceId) throws DataCatalogException; -} http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalogException.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalogException.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalogException.java deleted file mode 100644 index dbb0ee4..0000000 --- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/DataCatalogException.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.airavata.registry.cpi; - -public class DataCatalogException extends Exception{ - private static final long serialVersionUID = -2849422320739447602L; - - public DataCatalogException(Throwable e) { - super(e); - } - - public DataCatalogException(String message) { - super(message, null); - } - - public DataCatalogException(String message, Throwable e) { - super(message, e); - } -} http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java index e51389c..c33b9f2 100644 --- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java +++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java @@ -25,5 +25,4 @@ public interface Registry { public ExperimentCatalog getExperimentCatalog() throws RegistryException; public ExperimentCatalog getExperimentCatalog(String gatewayId, String username, String password) throws RegistryException; public AppCatalog getAppCatalog() throws RegistryException; - public DataCatalog getDataCatalog() throws RegistryException; } http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/airavata-apis/airavata_api.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift index 2eca176..74d94b3 100644 --- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift +++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift @@ -2712,52 +2712,6 @@ service Airavata { 3: airavata_errors.AiravataSystemException ase, 4: airavata_errors.AuthorizationException ae) - /** - * Data Manager Related API Methods - **/ - string registerDataResource(1: required security_model.AuthzToken authzToken, 2: required replica_catalog_models.DataResourceModel dataResourceModel) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - - void updateDataResource(1: required security_model.AuthzToken authzToken, 2: required replica_catalog_models.DataResourceModel dataResourceModel) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - - void removeDataResource(1: required security_model.AuthzToken authzToken, 2: required string resourceId) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - - replica_catalog_models.DataResourceModel getDataResource(1: required security_model.AuthzToken authzToken, 2: required string resourceId) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - - string copyDataResource(1: required security_model.AuthzToken authzToken, - 2: required string resourceId, - 3: required string destStorageResourceId, - 4: required string destinationParentPath) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - - string copyDataReplica(1: required security_model.AuthzToken authzToken, - 2: required string resourceId, - 3: required string replicaId, - 4: required string destStorageResourceId, - 5: required string destinationParentPath) - throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) - //End of API } http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/airavata_data_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/airavata_data_models.thrift b/thrift-interface-descriptions/data-models/airavata_data_models.thrift index edea087..33783e5 100644 --- a/thrift-interface-descriptions/data-models/airavata_data_models.thrift +++ b/thrift-interface-descriptions/data-models/airavata_data_models.thrift @@ -30,8 +30,8 @@ include "experiment-catalog-models/process_model.thrift" include "experiment-catalog-models/scheduling_model.thrift" include "experiment-catalog-models/status_models.thrift" include "resource-catalog-models/data_movement_models.thrift" -include "data-manager-models/replica_models.thrift" -include "data-manager-models/file_models.thrift" +include "file-manager-models/replica_models.thrift" +include "file-manager-models/file__transfer_models.thrift" namespace java org.apache.airavata.model namespace php Airavata.Model http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/data-manager-models/file_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/data-manager-models/file_models.thrift b/thrift-interface-descriptions/data-models/data-manager-models/file_models.thrift deleted file mode 100644 index bdcf784..0000000 --- a/thrift-interface-descriptions/data-models/data-manager-models/file_models.thrift +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - namespace java org.apache.airavata.model.file - namespace php Airavata.Model.File - namespace cpp apache.airavata.model.file - namespace py apache.airavata.model.file - - enum FileNodeTypes{ - DIRECTORY, - FILE - } - - struct FileNode { - 1: optional FileNodeTypes type, - 2: optional string size, - 3: optional string nativeType, - 4: optional string name, - 5: optional string path, - 6: optional string storageResourceId, - 7: optional i64 lastModifiedType, - 8: optional i64 createdTime, - 9: optional list<FileNode> childNodes - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/data-manager-models/metadata_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/data-manager-models/metadata_models.thrift b/thrift-interface-descriptions/data-models/data-manager-models/metadata_models.thrift deleted file mode 100644 index 927c92f..0000000 --- a/thrift-interface-descriptions/data-models/data-manager-models/metadata_models.thrift +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/data-manager-models/replica_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/data-manager-models/replica_models.thrift b/thrift-interface-descriptions/data-models/data-manager-models/replica_models.thrift deleted file mode 100644 index f010b6c..0000000 --- a/thrift-interface-descriptions/data-models/data-manager-models/replica_models.thrift +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - - include "../resource-catalog-models/data_movement_models.thrift" - - namespace java org.apache.airavata.model.replica - namespace php Airavata.Model.Replica - namespace cpp apache.airavata.model.replica - namespace py apache.airavata.model.replica - -enum ReplicaLocationCategory { - GATEWAY_DATA_STORE, - COMPUTE_RESOURCE, - LONG_TERM_STORAGE_RESOURCE, - OTHER -} - -enum ReplicaPersistentType { - TRANSIENT, - PERSISTENT -} - -enum DataResourceType { - COLLECTION, - FILE -} - -struct DataResourceModel { - 1: optional string resourceId, - 2: optional string gatewayId, - 3: optional string parentResourceId, - 4: optional string resourceName, - 5: optional string resourceDescription, - 6: optional string ownerName, - 7: optional string sha256Checksum, - 8: optional DataResourceType dataResourceType, - 9: optional i32 resourceSize, - 10: optional string nativeFormat, - 11: optional i64 creationTime, - 12: optional i64 lastModifiedTime, - 13: optional map<string, string> resourceMetadata, - 14: optional list<DataReplicaLocationModel> replicaLocations, - 15: optional list<DataResourceModel> childResources -} - -struct DataReplicaLocationModel { - 1: optional string replicaId, - 2: optional string resourceId, - 3: optional string replicaName, - 4: optional string replicaDescription, - 5: optional string sourceReplicaId, - 6: optional i64 creationTime, - 7: optional i64 lastModifiedTime, - 8: optional i64 validUntilTime, - 9: optional ReplicaLocationCategory replicaLocationCategory, - 10: optional ReplicaPersistentType replicaPersistentType, - 11: optional string storageResourceId, - 12: optional string fileAbsolutePath, - 13: optional map<string, string> replicaMetadata -} http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/file-manager-models/file__transfer_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/file-manager-models/file__transfer_models.thrift b/thrift-interface-descriptions/data-models/file-manager-models/file__transfer_models.thrift new file mode 100644 index 0000000..4600aa4 --- /dev/null +++ b/thrift-interface-descriptions/data-models/file-manager-models/file__transfer_models.thrift @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + + namespace java org.apache.airavata.model.file + namespace php Airavata.Model.File + namespace cpp apache.airavata.model.file + namespace py apache.airavata.model.file + + enum StorageResourceProtocol{ + SCP,SFTP,HTTP,HTTPS,GridFTP,LOCAL + } + + enum FileNodeTypes{ + DIRECTORY, + FILE + } + + enum FileTransferMode{ + SYNC,ASYNC + } + + enum FileTransferStatus{ + CREATED, QUEUED, RUNNING, COMPLETED, FAILED + } + + struct FileTransferRequest{ + 1: optional string transferId, + 2: optional string srcHostname, + 3: optional string srcLoginName, + 4: optional i64 srcPort, + 5: optional StorageResourceProtocol srcProtocol, + 6: optional string srcFilePath, + 7: optional string srcHostCredToken, + 8: optional string destHostname, + 9: optional string destLoginName, + 10: optional i64 destPort, + 11: optional StorageResourceProtocol destProtocol, + 12: optional string destFilePath, + 13: optional string destHostCredToken, + 14: optional FileTransferMode fileTransferMode, + 15: optional FileTransferStatus transferStatus, + 16: optional i64 fileSize, + 17: optional i64 transferTime, + 18: optional i64 createdTime, + 19: optional i64 lastModifiedType + } + + struct FileNode { + 1: optional FileNodeTypes type, + 2: optional i64 size, + 3: optional string nativeType, + 4: optional string name, + 5: optional string path, + 6: optional string storageHostName, + 7: optional i64 lastModifiedType, + 8: optional i64 createdTime + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/file-manager-models/metadata_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/file-manager-models/metadata_models.thrift b/thrift-interface-descriptions/data-models/file-manager-models/metadata_models.thrift new file mode 100644 index 0000000..927c92f --- /dev/null +++ b/thrift-interface-descriptions/data-models/file-manager-models/metadata_models.thrift @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ http://git-wip-us.apache.org/repos/asf/airavata/blob/5881af94/thrift-interface-descriptions/data-models/file-manager-models/replica_models.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/data-models/file-manager-models/replica_models.thrift b/thrift-interface-descriptions/data-models/file-manager-models/replica_models.thrift new file mode 100644 index 0000000..f010b6c --- /dev/null +++ b/thrift-interface-descriptions/data-models/file-manager-models/replica_models.thrift @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + + include "../resource-catalog-models/data_movement_models.thrift" + + namespace java org.apache.airavata.model.replica + namespace php Airavata.Model.Replica + namespace cpp apache.airavata.model.replica + namespace py apache.airavata.model.replica + +enum ReplicaLocationCategory { + GATEWAY_DATA_STORE, + COMPUTE_RESOURCE, + LONG_TERM_STORAGE_RESOURCE, + OTHER +} + +enum ReplicaPersistentType { + TRANSIENT, + PERSISTENT +} + +enum DataResourceType { + COLLECTION, + FILE +} + +struct DataResourceModel { + 1: optional string resourceId, + 2: optional string gatewayId, + 3: optional string parentResourceId, + 4: optional string resourceName, + 5: optional string resourceDescription, + 6: optional string ownerName, + 7: optional string sha256Checksum, + 8: optional DataResourceType dataResourceType, + 9: optional i32 resourceSize, + 10: optional string nativeFormat, + 11: optional i64 creationTime, + 12: optional i64 lastModifiedTime, + 13: optional map<string, string> resourceMetadata, + 14: optional list<DataReplicaLocationModel> replicaLocations, + 15: optional list<DataResourceModel> childResources +} + +struct DataReplicaLocationModel { + 1: optional string replicaId, + 2: optional string resourceId, + 3: optional string replicaName, + 4: optional string replicaDescription, + 5: optional string sourceReplicaId, + 6: optional i64 creationTime, + 7: optional i64 lastModifiedTime, + 8: optional i64 validUntilTime, + 9: optional ReplicaLocationCategory replicaLocationCategory, + 10: optional ReplicaPersistentType replicaPersistentType, + 11: optional string storageResourceId, + 12: optional string fileAbsolutePath, + 13: optional map<string, string> replicaMetadata +}
