com.sas.hls.drug.analysis
Interface AnalysisService


public interface AnalysisService

The analysis service provides methods to manage the life cycle of an analysis and get information about an analysis. A user with appropriate authorization can create, delete, update or get analysis details using the appropriate methods of this service. An analysis is defined within a project context and the context is required for creating and getting information about an analysis.


Method Summary
 boolean analysisExists(ProjectDescriptor project, String name)
          Checks if the analysis specified by name exists for the specified project.
 Analysis createAnalysis(ProjectDescriptor projectContext, String analysisName, List<Attribute> attributes)
          Create an analysis in the specified project.
 void deleteAnalysis(AnalysisDescriptor analysis)
          Delete the specified analysis and all of its children.
 List<Analysis> getAnalysesByProject(ProjectDescriptor project)
          Get all the analyses defined in the specified project.
 Analysis getAnalysisByIdentifier(String identifier)
          Get the analysis specified by its identifier.
 Analysis getAnalysisByName(ProjectDescriptor project, String name)
          Get the analysis specified by name in the given project.
 AnalysisDescriptor getAnalysisDescriptorByIdentifier(String identifier)
          Get the light-weight representation of the analysis specified by its identifier.
 AnalysisDescriptor getAnalysisDescriptorByName(ProjectDescriptor project, String name)
          Get the light-weight representation of the analysis specified by name in the given project.
 List<AnalysisDescriptor> getAnalysisDescriptorsByProject(ProjectDescriptor project)
          Get light-weight representations of all the analyses defined in the specified project.
 List<AttributeDefinition> getAttributeDefinitionsForAnalysisType()
          Get the set of attribute definitions on the analysis type including system and extended attributes.
 List<Attribute> getCreationAttributesForAnalysisType()
          Get the set of attributes that may be specified when creating an analysis.
 Analysis renameAnalysis(Analysis analysis, String newName)
          Rename the specified analysis with the new name specified.
 

Method Detail

createAnalysis

Analysis createAnalysis(ProjectDescriptor projectContext,
                        String analysisName,
                        List<Attribute> attributes)
                        throws ProjectNotFoundException,
                               AnalysisExistsException
Create an analysis in the specified project.

Parameters:
projectContext - The parent project of the analysis to be created.
analysisName - The name of the analysis to create.
attributes - A collection of Attribute objects associated with the Analysis type that can be specified at creation. Use getCreationAttributesForAnalysisType() to get the collection of creation attributes.
Returns:
The newly created analysis.
Throws:
ProjectNotFoundException - The specified parent project was not found.
AnalysisExistsException - An analysis with this name already exists.

analysisExists

boolean analysisExists(ProjectDescriptor project,
                       String name)
Checks if the analysis specified by name exists for the specified project.

Parameters:
project - The parent project of the analysis in question.
name - The name of the analysis in question.
Returns:
true if analysis exists and user is authorized to view this analysis, false otherwise

getAnalysisByIdentifier

Analysis getAnalysisByIdentifier(String identifier)
                                 throws AnalysisNotFoundException
Get the analysis specified by its identifier.

Parameters:
identifier - analysis identifier which uniquely identifies this object in the system
Returns:
Analysis The analysis with the specified identifier.
Throws:
AnalysisNotFoundException - An analysis with the specified identifier could not be found.

getAnalysisByName

Analysis getAnalysisByName(ProjectDescriptor project,
                           String name)
                           throws AnalysisNotFoundException
Get the analysis specified by name in the given project.

Parameters:
project - The parent project of the desired analysis.
name - analysis name The name of the desired analysis.
Returns:
Analysis The desired analysis.
Throws:
AnalysisNotFoundException - The specified analysis could not be found.

getAnalysisDescriptorByIdentifier

AnalysisDescriptor getAnalysisDescriptorByIdentifier(String identifier)
                                                     throws AnalysisNotFoundException
Get the light-weight representation of the analysis specified by its identifier.

Parameters:
identifier - The identifier of the desired analysis.
Returns:
Analysis The desired analysis.
Throws:
AnalysisNotFoundException - An analysis with the specified identifier could not be found.

getAnalysisDescriptorByName

AnalysisDescriptor getAnalysisDescriptorByName(ProjectDescriptor project,
                                               String name)
                                               throws AnalysisNotFoundException
Get the light-weight representation of the analysis specified by name in the given project.

Parameters:
project - The parent project of the desired analysis.
name - The name of the desired analysis.
Returns:
Analysis The desired analysis.
Throws:
AnalysisNotFoundException - An analysis with the specified name could not be found in the specified project.

getAnalysisDescriptorsByProject

List<AnalysisDescriptor> getAnalysisDescriptorsByProject(ProjectDescriptor project)
                                                         throws ProjectNotFoundException
Get light-weight representations of all the analyses defined in the specified project.

Parameters:
project - The parent project of the desired analyses.
Returns:
The list of all analysis descriptors in the specified project.
Throws:
ProjectNotFoundException - The specified parent project was not found.

getAnalysesByProject

List<Analysis> getAnalysesByProject(ProjectDescriptor project)
                                    throws ProjectNotFoundException
Get all the analyses defined in the specified project.

Parameters:
project - The parent project of the desired analysis.
Returns:
The list of all analyses in the specified project.
Throws:
ProjectNotFoundException - The specified parent project was not found.

renameAnalysis

Analysis renameAnalysis(Analysis analysis,
                        String newName)
                        throws AnalysisNotFoundException,
                               AnalysisRenameException
Rename the specified analysis with the new name specified. A user must have properties write permission granted in order to rename an analysis.

Parameters:
analysis - The analysis to be renamed.
newName - The new name to give to the analysis.
Returns:
The renamed analysis.
Throws:
AnalysisNotFoundException - The analysis to be renamed does not exist.
AnalysisRenameException - The analysis can not be renamed (Check exception to see if name is too long, is illegal, or is already being used).

deleteAnalysis

void deleteAnalysis(AnalysisDescriptor analysis)
                    throws AnalysisNotFoundException
Delete the specified analysis and all of its children. User needs to have delete permissions granted in order to delete an analysis. The deleted analysis will be moved to the trashcan and reside there until a user with appropriate authorization can permanently delete it.

Parameters:
analysis - The analysis to be deleted.
Throws:
AnalysisNotFoundException - The specified analysis does not exist.

getCreationAttributesForAnalysisType

List<Attribute> getCreationAttributesForAnalysisType()
                                                     throws TypeNotFoundException
Get the set of attributes that may be specified when creating an analysis.

Returns:
List of Attribute objects that includes system and extended attributes that may be specified while creating an analysis. The returned Name fields are initialized while the value fields are set to null and may be set before passing the list into the analysis create method.
Throws:
TypeNotFoundException

getAttributeDefinitionsForAnalysisType

List<AttributeDefinition> getAttributeDefinitionsForAnalysisType()
                                                                 throws TypeNotFoundException
Get the set of attribute definitions on the analysis type including system and extended attributes. Each attribute definition will provide metadata about the attributes such as name, display name, is the attribute required, is the attribute editable by an end user, its type and other relevant information.

Returns:
List of attribute definitions
Throws:
TypeNotFoundException


Copyright (c) 2012, SAS Institute Inc., Cary, NC, USA