|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.Install
public final class Install
This class contains static methods used to install items into an empty database.
Nested Class Summary | |
---|---|
private static class |
Install.PlatformFT
|
Field Summary | |
---|---|
private static Logger |
log
Log core events. |
static int |
NEW_SCHEMA_VERSION
The schema version to give to new installations. |
private static SchemaVersionData |
schemaVersion
|
private static org.hibernate.Session |
session
|
private static SessionControl |
sessionControl
|
Constructor Summary | |
---|---|
Install()
|
Method Summary | |
---|---|
private static void |
addRolePermissions(RoleData role,
Map<Item,Integer> permissions)
Add permissions for a role for specific item types. |
private static AnnotationTypeData |
createAnnotationType(String name,
String description,
Type type,
int multiplicity,
Object[] enumeration,
Item[] itemTypes,
Map<String,String> options,
boolean requiredForMiame,
boolean isProtocolParameter,
UserData owner,
ItemKeyData shareTo)
Create an AnnotationType . |
private static BioPlateEventTypeData |
createBioPlateEventType(String name,
String systemId,
String description)
Create a BioPlateEventType . |
private static BioPlateTypeData |
createBioPlateType(String name,
String description,
Item biomaterialType,
BioWell.LockMode lockedMode)
Create a BioPlateType . |
private static ClientData |
createClient(UserData owner,
String externalId,
String name,
String description,
ItemKeyData key)
Create a Client . |
private static DataFileTypeData |
createDataFileType(String externalId,
String name,
String description,
Item itemType,
String extension,
FileTypeData genericType,
String validatorClass,
String metadataReaderClass)
Create a DataFileType . |
private static DirectoryData |
createDirectory(UserData owner,
DirectoryData parent,
String systemId,
String name,
String description,
ItemKeyData itemKey,
boolean autoCompress)
Create a Directory . |
private static FileTypeData |
createFileType(String systemId,
String name,
String description)
Create a FileType . |
private static FormulaData |
createFormula(Formula.Type type,
Type valueType,
Formula.Parser parser,
Formula.AverageMethod avgMethod,
IntensityTransform source,
IntensityTransform result,
String name,
String description,
String rawDataType,
int channels,
String[] formulas,
ColoringData coloring,
UserData owner,
ItemKeyData shareTo)
Create a Formula . |
private static GroupData |
createGroup(String systemId,
String name,
boolean isDefault,
boolean hiddenMembers,
String description)
Create a Group . |
private static HardwareData |
createHardware(String name,
String version,
String description,
HardwareTypeData type,
UserData owner,
ItemKeyData shareTo)
Create a HardwareData . |
private static HardwareTypeData |
createHardwareType(String systemId,
String name,
String description)
Create a HardwareType . |
private static ItemKeyData |
createItemKey(String message,
Map<UserData,Integer> userPermissions,
Map<GroupData,Integer> groupPermissions)
Create an ItemKey . |
private static LabelData |
createLabel(String name,
String description,
UserData owner,
ItemKeyData shareTo)
Create a Label . |
private static MimeTypeData |
createMimeType(String name,
String description,
String extension,
FileTypeData fileType,
boolean autoCompress)
Create a MimeType . |
private static NewsData |
createNews(String name,
String description)
Create a News . |
private static PlateGeometryData |
createPlateGeometry(String name,
String description,
int rows,
int columns)
Create a PlateGeometry . |
private static PlateMappingData |
createPlateMapping(String name,
String description,
PlateGeometryData source,
int sourceCount,
PlateGeometryData destination,
int destinationCount,
String image,
UserData owner,
ItemKeyData shareTo)
Create a PlateMapping . |
private static PlatformData |
createPlatform(String externalId,
String name,
String description,
boolean fileOnly,
String rawDataType,
int channels,
Install.PlatformFT... fileTypes)
Create a Platform . |
private static void |
createPluginConfigurations(String filePath,
boolean update)
Create PluginConfiguration s from a XML file. |
private static PluginDefinition |
createPluginDefinition(String className,
String jarPath,
ItemKeyData shareTo,
boolean trusted,
Long maxMemory,
boolean allowImmediateExecution)
Create a PluginDefinition . |
private static PluginTypeData |
createPluginType(String name,
String description,
String interfaceName,
String jarPath)
Create a PluginType . |
private static ProtocolTypeData |
createProtocolType(String systemId,
String name,
String description)
Create a ProtocolType . |
private static QuantityData |
createQuantity(String systemId,
String name,
String description,
String referenceUnit)
Create a Quantity . |
private static QuotaData |
createQuota(String systemId,
String name,
String description,
long totalPrimaryQuota)
Create a Quota . |
private static QuotaTypeData |
createQuotaType(String systemId,
String name,
String description,
boolean secondaryLocation)
Create a QuotaType . |
private static RoleData |
createRole(String systemId,
String name,
boolean isDefault,
String description)
Create a Role . |
private static RoleKeyData |
createRoleKey(Item itemType,
String name,
String description,
Map<RoleData,Integer> permissions)
Create a RoleKey . |
private static SchemaVersionData |
createSchemaVersion(int sv)
Create the schema version. |
private static SoftwareData |
createSoftware(String name,
String version,
String description,
SoftwareTypeData type,
UserData owner,
ItemKeyData shareTo)
Create a Software . |
private static SoftwareTypeData |
createSoftwareType(String systemId,
String name,
String description)
Create a SoftwareType . |
static void |
createTables(boolean update,
ProgressReporter progress)
|
private static UnitData |
createUnit(QuantityData quantity,
String name,
String description,
double factor,
double offset,
String symbol,
String... aliasSymbols)
Create a Unit . |
private static UserData |
createUser(String systemId,
String login,
String password,
String name,
String description,
RoleData role,
QuotaData quota,
boolean disabled,
boolean multiUserAccount)
Create a User . |
static void |
initDatabase(boolean update,
ProgressReporter progress,
String rootLogin,
String rootPassword)
Initialise the BASE database by creating all items that are required for BASE to work properly. |
private static void |
installUnits(String xmlFile,
boolean update)
|
private static void |
setPermissions(Item itemType,
int itemId,
ItemKeyData itemKey,
ProjectKeyData projectKey)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private static org.hibernate.Session session
private static SchemaVersionData schemaVersion
private static SessionControl sessionControl
public static final int NEW_SCHEMA_VERSION
Update.updateDatabase(ProgressReporter, String, String)
method.
Constructor Detail |
---|
public Install()
Method Detail |
---|
public static void createTables(boolean update, ProgressReporter progress) throws BaseException
BaseException
public static void initDatabase(boolean update, ProgressReporter progress, String rootLogin, String rootPassword) throws BaseException
update
- TRUE if the run is an update, FALSE otherwise.progress
- An object implementing the ProgressReporter
interfacerootLogin
- The root user's login name.rootPassword
- The root user's password.
BaseException
- This exception is thrown if there is an errorprivate static SchemaVersionData createSchemaVersion(int sv) throws BaseException
BaseException
private static DirectoryData createDirectory(UserData owner, DirectoryData parent, String systemId, String name, String description, ItemKeyData itemKey, boolean autoCompress) throws BaseException
Directory
.
BaseException
private static MimeTypeData createMimeType(String name, String description, String extension, FileTypeData fileType, boolean autoCompress) throws BaseException
MimeType
.
BaseException
private static FileTypeData createFileType(String systemId, String name, String description) throws BaseException
FileType
.
BaseException
private static QuotaTypeData createQuotaType(String systemId, String name, String description, boolean secondaryLocation) throws BaseException
QuotaType
.
BaseException
private static QuotaData createQuota(String systemId, String name, String description, long totalPrimaryQuota) throws BaseException
Quota
.
BaseException
private static UserData createUser(String systemId, String login, String password, String name, String description, RoleData role, QuotaData quota, boolean disabled, boolean multiUserAccount) throws BaseException
User
.
BaseException
private static GroupData createGroup(String systemId, String name, boolean isDefault, boolean hiddenMembers, String description) throws BaseException
Group
.
BaseException
private static RoleData createRole(String systemId, String name, boolean isDefault, String description) throws BaseException
Role
.
BaseException
private static void installUnits(String xmlFile, boolean update)
private static QuantityData createQuantity(String systemId, String name, String description, String referenceUnit) throws BaseException
Quantity
.
BaseException
private static UnitData createUnit(QuantityData quantity, String name, String description, double factor, double offset, String symbol, String... aliasSymbols) throws BaseException
Unit
.
BaseException
private static ProtocolTypeData createProtocolType(String systemId, String name, String description) throws BaseException
ProtocolType
.
BaseException
private static SoftwareTypeData createSoftwareType(String systemId, String name, String description) throws BaseException
SoftwareType
.
BaseException
private static SoftwareData createSoftware(String name, String version, String description, SoftwareTypeData type, UserData owner, ItemKeyData shareTo) throws BaseException
Software
.
BaseException
private static HardwareTypeData createHardwareType(String systemId, String name, String description) throws BaseException
HardwareType
.
BaseException
private static HardwareData createHardware(String name, String version, String description, HardwareTypeData type, UserData owner, ItemKeyData shareTo) throws BaseException
HardwareData
.
BaseException
private static BioPlateTypeData createBioPlateType(String name, String description, Item biomaterialType, BioWell.LockMode lockedMode) throws BaseException
BioPlateType
.
BaseException
private static BioPlateEventTypeData createBioPlateEventType(String name, String systemId, String description) throws BaseException
BioPlateEventType
.
BaseException
private static PlateGeometryData createPlateGeometry(String name, String description, int rows, int columns) throws BaseException
PlateGeometry
.
BaseException
private static PlateMappingData createPlateMapping(String name, String description, PlateGeometryData source, int sourceCount, PlateGeometryData destination, int destinationCount, String image, UserData owner, ItemKeyData shareTo) throws BaseException
PlateMapping
. At the moment only 1:1 and 4:1 mappings are allowed. If the 4:1 mapping
is choosen it creates a 1243 mapping as defines in the "Merge 96-well -> 384-well" in base 1.2.14.
source
- the PlateGeometry of the source plate(s).sourceCount
- the number of source plates. 1 or 4 at the moment.destination
- the PlateGeometry of the destination plate(s).destinationCount
- the number of destination plate. Only 1 at the moment.
BaseException
private static LabelData createLabel(String name, String description, UserData owner, ItemKeyData shareTo) throws BaseException
Label
.
BaseException
private static AnnotationTypeData createAnnotationType(String name, String description, Type type, int multiplicity, Object[] enumeration, Item[] itemTypes, Map<String,String> options, boolean requiredForMiame, boolean isProtocolParameter, UserData owner, ItemKeyData shareTo)
AnnotationType
.
private static RoleKeyData createRoleKey(Item itemType, String name, String description, Map<RoleData,Integer> permissions) throws BaseException
RoleKey
.
permissions
- A map with RoleData as keys and permission codes as values
BaseException
private static void addRolePermissions(RoleData role, Map<Item,Integer> permissions)
role
- The role to add the permissions topermissions
- The permissions to addprivate static ItemKeyData createItemKey(String message, Map<UserData,Integer> userPermissions, Map<GroupData,Integer> groupPermissions) throws BaseException
ItemKey
.
message
- Message will be written to the loguserPermissions
- A map with UserData as keys and permission codes as valuesgroupPermissions
- A map with GroupData as keys and permission codes as values
BaseException
private static ClientData createClient(UserData owner, String externalId, String name, String description, ItemKeyData key) throws BaseException
Client
.
BaseException
private static NewsData createNews(String name, String description) throws BaseException
News
.
BaseException
private static PluginTypeData createPluginType(String name, String description, String interfaceName, String jarPath) throws BaseException
PluginType
.
BaseException
private static PluginDefinition createPluginDefinition(String className, String jarPath, ItemKeyData shareTo, boolean trusted, Long maxMemory, boolean allowImmediateExecution) throws BaseException
PluginDefinition
.
BaseException
private static void createPluginConfigurations(String filePath, boolean update) throws BaseException
PluginConfiguration
s from a XML file.
BaseException
private static FormulaData createFormula(Formula.Type type, Type valueType, Formula.Parser parser, Formula.AverageMethod avgMethod, IntensityTransform source, IntensityTransform result, String name, String description, String rawDataType, int channels, String[] formulas, ColoringData coloring, UserData owner, ItemKeyData shareTo) throws BaseException
Formula
.
BaseException
private static PlatformData createPlatform(String externalId, String name, String description, boolean fileOnly, String rawDataType, int channels, Install.PlatformFT... fileTypes) throws BaseException
Platform
.
BaseException
private static DataFileTypeData createDataFileType(String externalId, String name, String description, Item itemType, String extension, FileTypeData genericType, String validatorClass, String metadataReaderClass) throws BaseException
DataFileType
.
BaseException
private static void setPermissions(Item itemType, int itemId, ItemKeyData itemKey, ProjectKeyData projectKey)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |