Package rasj.odmg
Class RasODMGImplementation
- java.lang.Object
-
- rasj.odmg.RasODMGImplementation
-
- All Implemented Interfaces:
Implementation,RasCommDefs,RasImplementationInterface
public class RasODMGImplementation extends java.lang.Object implements RasImplementationInterface, RasCommDefs
This class implements the internal ODMG Bootstrap Object used by the rasj.odmg package. Because it contains a lot of functionality for internal purposes (e.g. methods for the RasManager), this class is not the official Implementation object the user works with, it is only used by the rasj.odmg package.The public Implementation object is the class
rasj.RasImplementation, which internally works with a RasODMGImplementation object.- See Also:
RasImplementation
-
-
Field Summary
-
Fields inherited from interface rasj.clientcommhttp.RasCommDefs
BIG_ENDIAN, BROWSER, LITTLE_ENDIAN, RASCLIENT, RESPONSE_ERROR, RESPONSE_INT, RESPONSE_MDDS, RESPONSE_OID, RESPONSE_OK, RESPONSE_OK_NEGATIVE, RESPONSE_SKALARS
-
-
Constructor Summary
Constructors Constructor Description RasODMGImplementation(java.lang.String server)Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortTA()Abort a transaction.voidbeginTA()Begin a transaction.voidcloseDB()Closes an open database.voidcommitTA()Commit a transaction.voidconnectClient(java.lang.String userName, java.lang.String passwordHash)TransactioncurrentTransaction()Get current transaction for thread, or NULL if none.intdbIsOpen()Tells whether database is open.voiddisconnectClient()intgetAccessMode()Gets the database access modejava.lang.StringgetBodyLine(java.io.BufferedReader ds)intgetClientID()Gets the client IDDatabasegetDatabase(java.lang.Object obj)Not implemented yet.java.lang.StringgetErrorStatus()Gets the current error statusvoidgetFreeServer()Requests a free server and retry'sintgetMaxRetry()Get the maximum retry parameterjava.lang.StringgetObjectId(java.lang.Object obj)Get a String representation of the object's identifier.java.lang.StringgetRasServer()Gets the name of the actual server.intgetResultCode(java.io.BufferedReader ds)java.lang.StringgetTypeStructure(java.lang.String typename, int typetype)booleanisOpenTA()Returns TRUE if a transaction is currently open.DArraynewDArray()Not implemented yet.DatabasenewDatabase()Create a new database object.DBagnewDBag()Create a new DBag object.DListnewDList()Create a new DList object.DMapnewDMap()Not implemented yet.DSetnewDSet()Create a new DSet object.OQLQuerynewOQLQuery()Create a new query object.TransactionnewTransaction()Create a new transaction object and associate it with the current thread.voidopenDB(java.lang.String name, int accessMode)Open databasejava.lang.ObjectqueryRequest(java.lang.String parameters)voidsetMaxRetry(int newRetry)Set the maximum retry parametervoidsetUserIdentification(java.lang.String userName, java.lang.String plainPass)voidsetUserIdentificationHashed(java.lang.String userName, java.lang.String passwordMD5Hash)
-
-
-
Method Detail
-
getRasServer
public java.lang.String getRasServer()
Gets the name of the actual server.- Specified by:
getRasServerin interfaceRasImplementationInterface- Returns:
- the name of the RasDaMan server used
-
dbIsOpen
public int dbIsOpen()
Tells whether database is open.- Specified by:
dbIsOpenin interfaceRasImplementationInterface- Returns:
- open status of database
-
getClientID
public int getClientID()
Gets the client ID- Specified by:
getClientIDin interfaceRasImplementationInterface- Returns:
- ID of this client
-
getAccessMode
public int getAccessMode()
Gets the database access mode- Specified by:
getAccessModein interfaceRasImplementationInterface- Returns:
- accessMode code: OPEN_READ_ONLY = 1; OPEN_READ_WRITE = 2; OPEN_EXCLUSIVE = 3
-
getErrorStatus
public java.lang.String getErrorStatus()
Gets the current error status- Specified by:
getErrorStatusin interfaceRasImplementationInterface- Returns:
- error status string
-
newTransaction
public Transaction newTransaction()
Create a new transaction object and associate it with the current thread.- Specified by:
newTransactionin interfaceImplementation- Specified by:
newTransactionin interfaceRasImplementationInterface- Returns:
- The newly created
Transactioninstance. - See Also:
Transaction
-
currentTransaction
public Transaction currentTransaction()
Get current transaction for thread, or NULL if none.- Specified by:
currentTransactionin interfaceImplementation- Specified by:
currentTransactionin interfaceRasImplementationInterface- Returns:
- The current
Transactionobject or null if there is none. - See Also:
Transaction
-
newDatabase
public Database newDatabase()
Create a new database object.- Specified by:
newDatabasein interfaceImplementation- Specified by:
newDatabasein interfaceRasImplementationInterface- Returns:
- The new
Databaseobject. - See Also:
Database
-
newOQLQuery
public OQLQuery newOQLQuery()
Create a new query object.- Specified by:
newOQLQueryin interfaceImplementation- Specified by:
newOQLQueryin interfaceRasImplementationInterface- Returns:
- The new
OQLQueryobject. - See Also:
OQLQuery
-
newDList
public DList newDList()
Create a new DList object.- Specified by:
newDListin interfaceImplementation- Specified by:
newDListin interfaceRasImplementationInterface- Returns:
- The new
DListobject. - See Also:
DList
-
newDBag
public DBag newDBag()
Create a new DBag object.- Specified by:
newDBagin interfaceImplementation- Specified by:
newDBagin interfaceRasImplementationInterface- Returns:
- The new
DBagobject. - See Also:
DBag
-
newDSet
public DSet newDSet()
Create a new DSet object.- Specified by:
newDSetin interfaceImplementation- Specified by:
newDSetin interfaceRasImplementationInterface- Returns:
- The new
DSetobject. - See Also:
DSet
-
newDArray
public DArray newDArray()
Not implemented yet.- Specified by:
newDArrayin interfaceImplementation- Specified by:
newDArrayin interfaceRasImplementationInterface- Returns:
- The new
DArrayobject. - See Also:
DArray
-
newDMap
public DMap newDMap()
Not implemented yet.- Specified by:
newDMapin interfaceImplementation- Specified by:
newDMapin interfaceRasImplementationInterface- Returns:
- The new
DMapobject. - See Also:
DMap
-
getObjectId
public java.lang.String getObjectId(java.lang.Object obj)
Get a String representation of the object's identifier.- Specified by:
getObjectIdin interfaceImplementation- Specified by:
getObjectIdin interfaceRasImplementationInterface- Parameters:
obj- The object whose identifier is being accessed.- Returns:
- The object's identifier in the form of a String
-
getDatabase
public Database getDatabase(java.lang.Object obj)
Not implemented yet.- Specified by:
getDatabasein interfaceImplementation- Specified by:
getDatabasein interfaceRasImplementationInterface- Parameters:
obj- The object.- Returns:
- The
Databasethat contains the object.
-
openDB
public void openDB(java.lang.String name, int accessMode) throws ODMGException, ODMGRuntimeExceptionOpen database- Specified by:
openDBin interfaceRasImplementationInterface- Throws:
ODMGExceptionODMGRuntimeException
-
closeDB
public void closeDB() throws ODMGExceptionCloses an open database. At the moment, only one database can be open at a given time and thus no parameter "database" is necessary here.- Specified by:
closeDBin interfaceRasImplementationInterface- Throws:
ODMGException
-
beginTA
public void beginTA()
Begin a transaction.- Specified by:
beginTAin interfaceRasImplementationInterface
-
isOpenTA
public boolean isOpenTA()
Returns TRUE if a transaction is currently open. This method MUST be sincere in that it asks the server about its state! (some apps use it to override timeout)- Specified by:
isOpenTAin interfaceRasImplementationInterface
-
commitTA
public void commitTA()
Commit a transaction.- Specified by:
commitTAin interfaceRasImplementationInterface
-
abortTA
public void abortTA()
Abort a transaction.- Specified by:
abortTAin interfaceRasImplementationInterface
-
setMaxRetry
public void setMaxRetry(int newRetry)
Set the maximum retry parameter- Specified by:
setMaxRetryin interfaceRasImplementationInterface
-
getMaxRetry
public int getMaxRetry()
Get the maximum retry parameter- Specified by:
getMaxRetryin interfaceRasImplementationInterface
-
getFreeServer
public void getFreeServer() throws RasQueryExecutionFailedException, RasConnectionFailedExceptionRequests a free server and retry's
-
queryRequest
public java.lang.Object queryRequest(java.lang.String parameters) throws RasQueryExecutionFailedException- Specified by:
queryRequestin interfaceRasImplementationInterface- Throws:
RasQueryExecutionFailedException
-
getTypeStructure
public java.lang.String getTypeStructure(java.lang.String typename, int typetype)- Specified by:
getTypeStructurein interfaceRasImplementationInterface
-
getResultCode
public int getResultCode(java.io.BufferedReader ds) throws java.io.IOException- Throws:
java.io.IOException
-
getBodyLine
public java.lang.String getBodyLine(java.io.BufferedReader ds) throws java.io.IOException- Throws:
java.io.IOException
-
setUserIdentification
public void setUserIdentification(java.lang.String userName, java.lang.String plainPass)- Specified by:
setUserIdentificationin interfaceRasImplementationInterface
-
setUserIdentificationHashed
public void setUserIdentificationHashed(java.lang.String userName, java.lang.String passwordMD5Hash)- Specified by:
setUserIdentificationHashedin interfaceRasImplementationInterface
-
connectClient
public void connectClient(java.lang.String userName, java.lang.String passwordHash)- Specified by:
connectClientin interfaceRasImplementationInterface
-
disconnectClient
public void disconnectClient()
- Specified by:
disconnectClientin interfaceRasImplementationInterface
-
-