com.ontimize.db
Class UserEntity
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.ontimize.db.TableEntity
com.ontimize.db.UserEntity
- All Implemented Interfaces:
- AdvancedEntity, AdvancedQueryEntity, Entity, EntityDataChangeNotifier, FileManagementEntity, IdentifiedEntity, PrivilegedSecurityEntity, java.rmi.Remote, SecureEntity, java.io.Serializable, TransactionalEntity
- public class UserEntity
- extends TableEntity
This class allows to use encrypted password automatically in database
It uses a 64 base encryption to obtain a valid character set for encrypted
password. So, password could be stored in any database engine.
- See Also:
- Serialized Form
|
Nested Class Summary |
protected static class |
UserEntity.EncryptWindow
Frame to obtains the encrypted value for a specified text |
|
Field Summary |
static boolean |
encrypt
Encrypt enable or disable. |
protected static java.lang.String |
Password
|
| Fields inherited from class com.ontimize.db.TableEntity |
alias, aliasPropertiesParser, aliasReverse, ASTERISK, ATTACHMENT_FILE_DESCRIPTION_COLUMN, ATTACHMENT_FILE_NAME_COLUMN, ATTACHMENT_FILE_NAME_KEYS, ATTACHMENT_FILE_ORIGINAL_NAME_COLUMN, ATTACHMENT_FILE_ORIGINAL_PATH_COLUMN, ATTACHMENT_FILE_PATH, ATTACHMENT_FILE_SIZE_COLUMN, ATTACHMENT_SEPARATOR, ATTACHMENT_TABLE, attachmentFileNameColumn, attachmentFileNameKeys, attachmentFilePath, attachmentFileSizeColumn, attachTable, AUTOCONFIGURATION, AUTONUMERICAL, autonumericalColumn, calendar, checkOperationResult, columnNames, COLUMNS, connectionRequestTime, dataChangeListeners, dBLocalErrorMessage, DEBUG, DEBUG_DETAILS, DEBUG_TIMES, DEFAULT_MAX_CONNECTION_WAIT_TIME, defaultEntityScriptManagerClassName, DELETE_ACTION, DELETE_KEYS, deleteKeys, descendantColumnsOrder, descriptionAttachmentFileColumn, enableScripting, entitiesPropertiesParser, entitiesTableAttribute, entityName, entityScripting, FETCH_SIZE, fetchSize, FILE_COLUMNS, fileInfoList, FORCE_DISTINCT, forceDistinct, INSERT_ACTION, INSERT_AUTOMATICLY_ATTACHMENT, INSERT_COLUMNS, INSERT_KEYS, insertAttachmentAutomatically, insertColumn, insertKeys, INTERROG, keys, KEYS, LIMIT_QUERY_OTHERS_ENTITIES, limitQueryOthersEntities, locator, LOG_KEYS, logDelete, logInsert, logkeys, logQuery, logUpdate, M_ERROR_OPERATION, M_IT_HAS_NOT_CHANGED_ANY_RECORD, M_LICENSE_PERMISSION_ERROR, M_TEMPORALY_RESTRICTED_BY_PERMISSION_ACTION, M_YOU_DO_NOT_HAVE_PERMISSION_TO_EXECUTE_ACTION, manager, maxConnectionWaitTime, oneToOneMode, orderColumns, originalAttachmentFileNameColumn, originalAttachmentFilePathColumn, OTHER_ENTITIES, othersEntities, PERCENT, PRINCIPAL_COLUMNS, PRINCIPAL_KEYS, PRINCIPAL_TABLE, principalColumnNames, principalKeyName, principalTable, privilegedId, properties, propertiesPath, QUERY_ACTION, QUERY_TABLE, queryTable, receivedAttachmentFile, receivedTempFiles, RECORD_OPERATIONS, registeredDispatcher, REPORT_ADVANCED_QUERY_COLUMNS, REPORT_ADVANCED_QUERY_TYPES, reportAvancedQueryColumns, reportAvancedQueryTypes, SECONDARY_COLUMNS, SECONDARY_KEYS, SECONDARY_TABLE, secondaryColumnsNames, secondaryKeyName, secondaryTable, sendAttachmentFile, SORT, SORT_DESC, table, TABLE, TABLE_ATTRIBUTE_ENTITIES, tempFiles, TIME_BETWEEN_DEFAULT_CONNECTION_REQUEST, TRUNCATE_DATE_DEFAULT_VALUE, TRUNCATE_DATES, truncateDates, UNDERSCORE, UPDATE_ACTION, UPDATE_COLUMNS, UPDATE_KEYS, updateColumn, updateKeys, USE_SETSTRING_LONG_STRINGS, useAlwaysTableAttributeEntities, WILDCARD_COLUMNS, wildcardColumns |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
|
Method Summary |
EntityResult |
insert(java.util.Hashtable attributesValues,
int sessionId,
java.sql.Connection con)
Executes an insert operation with the provided Connection.
|
static void |
main(java.lang.String[] arg)
|
EntityResult |
query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int sessionId,
java.sql.Connection con)
Executes a query operation using the provided Connection, with the
conditions and attributes required.
|
EntityResult |
update(java.util.Hashtable attributesValues,
java.util.Hashtable keysValues,
int sessionId,
java.sql.Connection con)
Executes an update operation with the provided Connection.
|
| Methods inherited from class com.ontimize.db.TableEntity |
addEntityDataChangeListener, buildConditionsString, cancelReceiving, checkDeleteKeys, checkFinishedSession, checkInsertKeys, checkOrderColumns, checkPermissions, checkUpdateKeys, configureReverseAlias, connect, connect, createAdvancedEntityResultForSessionId, createAdvancedEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityResultForSessionId, createEntityScriptManager, delete, delete, deleteAttachmentFile, deleteAttachmentFile, deleteMultipleTableAttributesColumns, disconnect, disconnect, dispatcherAttribute, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executePreparedStatement, executeStatement, finishReceiving, fireDataChangeEvent, fireDataChangeEvent, fireTransactionDataChangeEvent, fireTransactionDataChangeEvent, generateRandomId, getActions, getAliasForColumn, getAttachmentFileNameForKeys, getAttachmentFilePath, getAttachmentFilePath, getAutonumericalColumn, getBytes, getColumnForAlias, getColumnListForAvancedQuery, getColumns, getDatabaseConnectionManager, getDescOrderColumns, getDescription, getEntityPrivilegedId, getEntityReference, getErrorMessage, getExtendedAliasPropertiesName, getExtendedPropertiesName, getExtension, getName, getOrderColumns, getPrivilegedId, getPropertiesPath, getQueryRecordNumber, getQueryTable, getSize, getSQLTypesFromMetaData, getStringsOn, getSubGroupValues, getSubGroupValues, getTable, getUpdateColumns, getUser, getValidAttributes, getValidDeletingKeysValues, getValidInsertingAttributesValues, getValidQueryingKeysValues, getValidUpdatingAttributesValues, getValidUpdatingKeysValues, getWildCardColumns, insert, insertAutonumericalAlias, isBinaryType, loadAliasFile, loadAliasFile, logToLogKeys, logUpdate, parseStringValue, performExtendedAliasProperties, performExtendedProperties, postDelete, postInsert, postUpdate, preDelete, preInsert, prepareToReceive, prepareToReceive, prepareToReceive, prepareToTransfer, prepareToTransfer, preUpdate, processFileColumnsAttributes, processFileColumnsAttributes, processFileResults, processingMultipleValueAttributes, processingReferenceDataFieldAttributes, processingReferenceDataFieldAttributes, processMultipleAttributeKey, processMultipleTableAttribute, processMultipleTableAttribute, putBytes, query, query, query, query, queryOtherEntities, readProperties, readProperties, readProperties, registerAttributeDispatcher, reloadScripts, removeEntityDataChangeListener, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceAliasByColumn, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAlias, replaceColumnByAliasKeepColumns, resultSetToEntityResult, resultSetToEntityResult, resultSetToEntityResult, setLimitQueryOthersEntities, setName, setObject, setObject, setPrivilegedId, toVectorOfBooleans, truncateDataToHour_00_00_00, truncateDateToMinutes, update, updateAttachmentValues, vectorToStringSeparateBySemicolon |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
encrypt
public static boolean encrypt
- Encrypt enable or disable.
When UserEntity.encrypt is false this entity is the same as TableEntity
Password
protected static java.lang.String Password
UserEntity
public UserEntity(EntityReferenceLocator locator,
DatabaseConnectionManager databaseConnectionManager,
int port)
throws java.lang.Exception
query
public EntityResult query(java.util.Hashtable keysValues,
java.util.Vector attributes,
int sessionId,
java.sql.Connection con)
throws java.lang.Exception
- Description copied from class:
TableEntity
- Executes a query operation using the provided Connection, with the
conditions and attributes required.
This method calls
TableEntity.query(Hashtable, Vector, int, Connection, Vector, boolean) using
null and true as the last two parameters.
- Specified by:
query in interface TransactionalEntity- Overrides:
query in class TableEntity
- Parameters:
keysValues - attributes - sessionId - con -
- Returns:
-
- Throws:
java.lang.Exception - if an error ocurrs
insert
public EntityResult insert(java.util.Hashtable attributesValues,
int sessionId,
java.sql.Connection con)
throws java.lang.Exception
- Description copied from class:
TableEntity
- Executes an insert operation with the provided Connection.
The attributesValues object determines the columns and values
that will be inserted.
The sessionId number identifies the session.
When overriding, this method must suppose that the connection provided is
not in autocommit mode, so all operations are executed in a transaction.
This means that in an error ocurrs this method should throw an Exception
to ensure that the calling method is properly notified.
The following methods of this class are called:
- checkPermissions with INSERT_ACTION
- processMultipleTableAttribute
- processingReferenceDataFieldAttributes
- processingMultipleValueAttributes
- processFileColumnsAttributes
-
- replaceAliasByColumn
- processingReferenceDataFieldAttributes
- processFileColumnsAttributes
- replaceAliasByColumn
- checkInsertKeys
- getValidInsertingAttributesValues
- SQLStatementBuilder.createInsertQuery
- executePreparedStatement
- insertAutonumericalAlias
If no valid attributes-values are contained in
attributesValues no insert is performed and no error is
produced.
If there is no error, a TransactionDataChangeEvent is fired and all
listeners are notified.
- Specified by:
insert in interface TransactionalEntity- Overrides:
insert in class TableEntity
- Parameters:
attributesValues - the table columns and corresponding values to insertsessionId - the session identifiercon - the Connection to use when executing the PreparedStatement
- Returns:
- an EntityResult. This result will contain the autonumerical as a
key-value pair, where the key is the autonumerical column and the
value the autonumerical value
- Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute
the action.
update
public EntityResult update(java.util.Hashtable attributesValues,
java.util.Hashtable keysValues,
int sessionId,
java.sql.Connection con)
throws java.lang.Exception
- Description copied from class:
TableEntity
- Executes an update operation with the provided Connection.
The attributesValues object determines the columns that will
be updated and to which values.
The keysValues object determines the conditions that the
records that will be updated must fulfill, that is, the WHERE clause.
The sessionId number identifies the session.
When overriding, this method must suppose that the connection provided is
not in autocommit mode, so all operations are executed in a transaction.
This means that in an error ocurrs this method should throw an Exception
to ensure that the calling method is properly notified.
The following methods of this class are called:
- checkPermissions with UPDATE_ACTION
- processMultipleTableAttribute
- processingReferenceDataFieldAttributes
- processingMultipleValueAttributes
- processFileColumnsAttributes
-
- replaceAliasByColumn
- processingReferenceDataFieldAttributes
- processFileColumnsAttributes
- replaceAliasByColumn
- checkUpdateKeys
- getValidUpdatingAttributesValues
- getValidUpdatingKeysValues
- SQLStatementBuilder.createUpdateQuery
- executePreparedStatement
If no valid attributes-values are contained in
attributesValues no update is performed and no error is
produced.
If there is no error, a TransactionDataChangeEvent is fired and all
listeners are notified.
- Specified by:
update in interface TransactionalEntity- Overrides:
update in class TableEntity
- Parameters:
keysValues - the table columns and corresponding values to use as conditions
that the records to be updated must fulfillattributesValues - the table columns and corresponding values to insertsessionId - the session identifiercon - the Connection to use when executing the PreparedStatement
- Returns:
- an EntityResult This result is empty in the standard
implementation.
- Throws:
java.lang.Exception - if an error ocurrs or the caller has not permission to execute
the action.
main
public static final void main(java.lang.String[] arg)