Skip to content

Commit

Permalink
data api modified
Browse files Browse the repository at this point in the history
  • Loading branch information
rajithsiriwardana committed Oct 21, 2013
1 parent ae46fdb commit 62d4127
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/main/java/org/investovator/core/data/api/CompanyData.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public interface CompanyData {
*/
public HashMap<String,String> getCompanyIDsNames() throws DataAccessException;

/**
*
* @param symbol Company stockId
* @param companyName Company name
* @param shares number of shares issued
* @throws DataAccessException
*/
public void addCompanyData(String symbol, String companyName, int shares)
throws DataAccessException;

/**
*
* @return Company StockId and number of shares issued pairs
Expand All @@ -61,12 +71,22 @@ public interface CompanyData {

/**
*
* @param infotype Information type required
* @param infoType Information type required
* @param symbol StockId of the company
* @return Data
* @throws DataAccessException
*/
public Object getInfo(String infotype, String symbol) throws DataAccessException;
public Object getInfo(String infoType, String symbol) throws DataAccessException;

/**
*
* @param infoType Information type ex: annual dividend
* @param symbol stockId of the company
* @param object data
* @throws DataAccessException
*/
public void addInfo(String infoType, String symbol, Object object)
throws DataAccessException;

/**
*
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/org/investovator/core/data/api/CompanyDataImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ public HashMap<String,String> getCompanyIDsNames() throws DataAccessException{
return null; //TODO
}

/**
*
* {@inheritDoc}
*/
@Override
public void addCompanyData(String symbol, String companyName, int shares)
throws DataAccessException {
//TODO
}

/**
*
* {@inheritDoc}
Expand Down Expand Up @@ -74,6 +84,15 @@ public Object getInfo(String infotype, String symbol) throws DataAccessException
return null; //TODO
}

/**
*
* {@inheritDoc}
*/
@Override
public void addInfo(String infotype, String symbol, Object object) throws DataAccessException {
//TODO
}

/**
*
* {@inheritDoc}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/investovator/core/data/api/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public void addUser(String username, String firstname,

public HashMap<String, String> getUserDetails(String username) throws DataAccessException;

public void updateUserDetails(String username, HashMap<String, String> details)
throws DataAccessException;

public Portfolio getUserPortfolio(String username) throws DataAccessException;

public void updateUserPortfolio(String username, Portfolio portfolio) throws DataAccessException;

public ArrayList<String> getWatchList(String username);
}
10 changes: 10 additions & 0 deletions src/main/java/org/investovator/core/data/api/UserDataImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,22 @@ public HashMap<String, String> getUserDetails(String username)
return null; //TODO
}

@Override
public void updateUserDetails(String username, HashMap<String, String> details) throws DataAccessException {
//TODO
}

@Override
public Portfolio getUserPortfolio(String username)
throws DataAccessException {
return null; //TODO
}

@Override
public void updateUserPortfolio(String username, Portfolio portfolio) throws DataAccessException {
//TODO
}

@Override
public ArrayList<String> getWatchList(String username) {
return null; //TODO
Expand Down

0 comments on commit 62d4127

Please sign in to comment.