blob: fc91eb2415660073c83ae38516e8e9729ab58a42 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2020 RBEI and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v. 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Adhith Gopal - Initial API and Implementation
*******************************************************************************/
package org.eclipse.blockchain.core.interfaces;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
/**
* Interface for Ethereum Project
*/
public interface IEthereumProject1 {
/**
* This method is used to add the compiled solidity files to the set that is
* maintained in this project
*
* @param solidityFile - The compiled solidity file that belongs to this project
*/
public void addCompiledSolidityFiles(final IResource solidityFile);
/**
* This returns a set of compiled solidity files that is part of this project
*
* @return - Set of compiled solidity files
*/
public Set<IResource> getCompiledSolidityFiles();
/**
* Assigns the IProject to this Ethereum Project. This has to be invoked only
* once during creation of Ethereum Project
*
* @param project - The IProject.
*/
public void setProject(final IProject project);
/**
* Assigns the ProjectDescription for this Ethereum Project.
*
* @param projectDescription - The Project description associated with this
*/
public void setProjectDescription(final IProjectDescription projectDescription);
/**
* Returns the IProject associated with this Ethereum Project
*
* @return - The IProject.
*/
public IProject getProject();
/**
*
* @return - The Project description associated with this project
*/
public IProjectDescription getProjectDescription();
/**
* The file system location of the project that is associated with this.
*
* @return - File system location
*/
public String getProjectLocation();
/**
* This method is used to add the default natures that is associated with
* Ethereum Project
*/
public void addDefaultNatures();
/**
* This method is used to add the default builders that is associated with
* Ethereum Project
*/
public void addDefaultBuilders();
/**
*
* @return - The name of the project
*/
public String getProjectName();
/**
* This is used to assign the project builders associated with Ethereum Project.
*
* @param builderId - The builder id to add to project
*/
public void setProjectBuilders(String builderId);
/**
* This is used to add the project nature to the list of available project
* nature's.
*
* @param nature - The nature to be added.
*/
public void setProjectNatures(final String nature);
/**
*
* @return - Array of natures associated with this project
*/
public String[] getNatureIds();
/**
*
* @return - Array of builders associated with this project
*/
public String[] getBuilderIds();
/**
* This creates a deployment model for a smart contract that is deployed into a
* blockchain
*
* @param contractAddress - The contract address of the deployed SC
* @param scFile - The SC resource
* @param lastUsedAccount - The account that was last used for performing a
* transaction
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
*/
public void createDeploymentModel(final String contractAddress, final IResource scFile,
final String lastUsedAccount, final String environment);
/**
*
* @param scFile - The SC resource
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
* @return - The account that was last used for performing a transaction
*/
public String getLastUsedAccount(final IResource scFile, final String environment);
/**
* This is used to update the last used account(for transacting with blockchain)
*
* @param scFile - The SC resource
* @param accountDetails - The new account that was used for transaction
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
*/
public void updateLastUsedAccount(final IResource scFile, final String accountDetails, final String environment);
/**
*
* @param scFile - The SC resource
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
* @return - The contract address of the deployed SC
*/
public String getContractAddress(final IResource scFile, final String environment);
/**
* This method is used to remove the SC resource from the map which holds
* deployed resources
*
* @param resource - The SC resource
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
*/
public void removeDeploymentModelForResource(final IResource resource, final String environment);
/**
*
* @param scFile - The SC resource
* @param environment - This denotes the environment into which this SC is
* deployed(Embedded/Geth)
* @return - Whether the SC is deployed into the passed in environment
*/
public boolean isSCDeployed(final IResource scFile, final String environment);
}