package eu.smartlm.abs.portal.data.query;
import java.util.Date;
import java.util.Set;
import org.gridforum.x2003.urWg.HostDocument.Host;
import org.gridforum.x2003.urWg.ProjectNameDocument.ProjectName;
import org.gridforum.x2003.urWg.SubmitHostDocument.SubmitHost;
import org.gridforum.x2003.urWg.UserIdentityDocument.UserIdentity;
import eu.smartlm.schemas.x2009.x06.urec.FeatureType;
import eu.smartlm.schemas.x2009.x06.urec.ProductType;
import eu.smartlm.schemas.x2009.x06.urec.SmartLMUsageRecordType;
/**
* This interface defines the different necessary methods to construct the query and retrive the
* data form the Interface to EBS/Portal
* @author David García Pérez - CESGA
*
*/
public interface QueryConstructor {
/**
* Set-ups the url of the connection to get the data
* @param url
* @param cCtx
*/
public void setUpConnection(String url, String rampartRepo, String clientProperties);
/**
* Retrieves a collection of users from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of users (empty if no user matching the search criteria is found).
*/
public Set getListOfUsers(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of products from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of projects (empty if no user matching the search criteria is found).
*/
public Set getListOfProducts(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of projects from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of projects (empty if no user matching the search criteria is found).
*/
public Set getListOfProjects(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of hosts from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of hosts (empty if no user matching the search criteria is found).
*/
public Set getListOfHosts(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of submithosts from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of submitHosts (empty if no user matching the search criteria is found).
*/
public Set getListOfSubmitHosts(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of features from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of features (empty if no user matching the search criteria is found).
*/
public Set getListOfSubmitFeatures(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
/**
* Retrieves a collection of AccountingGroups from the database
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of accountinggroups (empty if no user matching the search criteria is found).
*/
public Set getListOfAccountingGroups(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
// This is not exactly to construct the query, but it is the final query constructed by the other methods
/**
* Retrieves a collection of SmartlmUsageRecords from the database (keep in mind that it needs a complete object tree)
* @param startDate delimiters users that have usagerecords starting from this date (null if no filter is applied)
* @param endDate delimiters users that have usagerecords ending from this date (null if no filter is applied)
* @param filterByUsers List of localUserId
to reduce the search space (null if no filter is applied)
* @param filterByProduct List of productId
to reduce the search space (null if no filter is applied)
* @param filterByProject List of ProjectName
to reduce the search space (null if no filter is applied)
* @param filterByHost List of hosts names to reduce the search space (null if no filter is applied)
* @param filterBySubmitHost List of submithost names to reduce the search space (null if no filter is applied)
* @param filterByFeature List of features names to reduce the search space (null if no filter is applied)
* @param filterByAccountingGroups List of accounting groups names to reduce the search space (null if no filter is applied)
* @return a list of SmartLMUsageRecords (empty if no user matching the search criteria is found).
*/
public Set getListOfSmartLMUsageRecords(
Date startDate,
Date endDate,
Set filterByUsers,
Set filterByProduct,
Set filterByProject,
Set filterByHost,
Set filterBySubmitHost,
Set filterByFeature,
Set filterByAccountingGroups);
}