* * PURPOSE: ODMG Implementation Bootstrap Object * * * COMMENTS: * ************************************************************ */ package rasj.odmg; import rasj.*; import rasj.global.*; import rasj.clientcommhttp.*; import org.odmg.*; import java.io.*; import java.net.*; import java.lang.*; import java.util.*; /** * 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
* {@link rasj.RasImplementation rasj.RasImplementation}, which internally works with a
* RasODMGImplementation object.
*
* @see rasj.RasImplementation
*/
public class RasODMGImplementation implements RasImplementationInterface,RasCommDefs//implements Implementation
{
private String rasServer = "";
private String rasMgr = "";
private int rasMgrPort= RasGlobalDefs.RASMGRPORT_DEFAULT;
private String userIdentification = RasGlobalDefs.GUESTIDENT_DEFAULT;
private String databaseName = "";
private String capability = "dummy";
private int maxRetry = RasGlobalDefs.MAX_GETFREESERVER_ATTEMPTS;
/**
* current state of transaction
**/
private boolean isOpenTA = false;
/**
/**
* This variable holds the current RasTransaction object.
*/
private RasTransaction transaction = null;
/**
* This variable holds the current Rasdatabase object.
*/
private RasDatabase database = null;
/**
* This variable holds the current RasOQLQuery object.
*/
private RasOQLQuery query = null;
/**
* The standard ODMG implementation sets the access mode when the database
* is opened, whereas the RasDaMan server expects this information when a
* transaction is started. Therefore it is saved in this variable.
*
* Available modes:
* OPEN_READ_ONLY = 1
* OPEN_READ_WRITE = 2
* OPEN_EXCLUSIVE = 3
*/
private int accessMode = 0;
/**
* Since ODMG does not specify a "isDatabaseOpen" method but provides a
* DatabaseClosedException, this variable is set to 1 if an openDB command is
* executed (closeDB sets it back to 0).
*/
private int dbIsOpen = 0;
/**
* This value is set to 1 if a transaction has been opened. Commiting or aborting
* a transaction sets it back to 0.
*/
private int taIsOpen = 0;
private int clientID = 0;
/**
* This value is used to store possible error messages of exceptions occuring
* when opening or closing transactions.
* The ODMG specification does not allow these operations to throw
* any exceptions, but our implementation could produce exceptions when connecting
* to the RasDaMan httpserver. In order to not get lost, these exception messages
* are stored in this variable.
*/
private String errorStatus = "";
// later: private String strUserAndPasswd = "anonymous:anonymouspasswd";
/**
* Standard constructor.
* @param server Complete URL of the RasDaMan httpserver (including port number)
*/
public RasODMGImplementation(String server)
{
Debug.enterVerbose( "RasODMGImplementation.constructor: start, server=" + server + "." );
try
{
// server address is http://server:port, we need server and port
StringTokenizer t=new StringTokenizer (server,"/");
String xxx=t.nextToken();
rasMgr =t.nextToken("/:");
String portStr = t.nextToken(":");
rasMgrPort = Integer.parseInt(portStr);
}
catch(NoSuchElementException e)
{
Debug.leaveVerbose( "RasODMGImplementation.constructor: done. server URL format error." );
throw new RasConnectionFailedException(RasGlobalDefs.URL_FORMAT_ERROR, server);
}
isOpenTA = false;
Debug.leaveVerbose( "RasODMGImplementation.constructor: done. ok." );
}
/**
* Gets the name of the actual server.
* @return the name of the RasDaMan server used
*/
public String getRasServer()
{
Debug.talkVerbose( "RasODMGImplementation.getRasServer: server=" + rasServer + "." );
return rasServer;
}
/**
* Tells whether database is open.
* @return open status of database
*/
public int dbIsOpen()
{
Debug.talkVerbose( "RasODMGImplementation.dbIsOpen: dbIsOpen=" + dbIsOpen + "." );
return dbIsOpen;
}
/**
* Gets the client ID
* @return ID of this client
*/
public int getClientID()
{
Debug.talkVerbose( "RasODMGImplementation.getClientID: clientID=" + clientID + "." );
return clientID;
}
/**
* Gets the database access mode
* @return accessMode code: OPEN_READ_ONLY = 1; OPEN_READ_WRITE = 2; OPEN_EXCLUSIVE = 3
*/
public int getAccessMode()
{
Debug.talkVerbose( "RasODMGImplementation.getAccessMode: accessMode=" + accessMode + "." );
return accessMode;
}
/**
* Gets the current error status
* @return error status string
*/
public String getErrorStatus()
{
Debug.talkVerbose( "RasODMGImplementation.getErrorStatus: errorStatus=" + errorStatus + "." );
return errorStatus;
}
/**
* Create a new transaction object and associate it with the current thread.
*/
public Transaction newTransaction()
{
Debug.enterVerbose( "RasODMGImplementation.newTransaction: start." );
transaction= new RasTransaction(this);
Debug.leaveVerbose( "RasODMGImplementation.newTransaction: done." );
return transaction;
}
/**
* Get current transaction for thread, or NULL if none.
*/
public Transaction currentTransaction()
{
Debug.talkVerbose( "RasODMGImplementation.currentTransaction." );
return transaction;
}
/**
* Create a new database object.
*/
public Database newDatabase()
{
Debug.enterVerbose( "RasODMGImplementation.newDatabase: start." );
database = new RasDatabase(this);
Debug.leaveVerbose( "RasODMGImplementation.newDatabase: done." );
return database;
}
/**
* Create a new query object.
*/
public OQLQuery newOQLQuery()
{
Debug.enterVerbose( "RasODMGImplementation.newOQLQuery: start." );
query = new RasOQLQuery(this);
Debug.leaveVerbose( "RasODMGImplementation.newOQLQuery: done." );
return query;
}
/**
* Create a new DList object.
*/
public DList newDList()
{
Debug.talkVerbose( "RasODMGImplementation.newDList." );
return new RasList();
}
/**
* Create a new DBag object.
*/
public DBag newDBag()
{
return new RasBag();
}
/**
* Create a new DSet object.
*/
public DSet newDSet()
{
Debug.talkVerbose( "RasODMGImplementation.newDSet." );
return new RasSet();
}
/**
* Not implemented yet.
*/
public DArray newDArray()
{
Debug.talkWarning( "RasODMGImplementation.newDArray: not yet implemented." );
throw new NotImplementedException();
}
/**
* Not implemented yet.
*/
public DMap newDMap()
{
Debug.talkWarning( "RasODMGImplementation.newDMap: not yet implemented." );
throw new NotImplementedException();
}
/**
* Get a String representation of the object's identifier.
* @returns: OID string on success, null otherwise
*/
public String getObjectId(Object obj)
{
Debug.enterVerbose( "RasODMGImplementation.getObjectId: start." );
if( ! (obj instanceof RasObject) ) // currently all must be derived from RasObject
{
Debug.leaveWarning( "RasODMGImplementation.getObjectId: not yet implemented." );
throw new NotImplementedException();
}
// if we come here: yes, we are derived from RasObject, let's proceed
RasOID roid = ((RasObject)obj).getOID();
String oid = roid.toString();
DBag resultBag = null;
if(!((RasObject)obj).getOID().isValid()) // OID of our object is not valid -> get one
{
Debug.talkWarning( "RasODMGImplementation.getObjectId: OID not Valid: " + roid + "." );
String params = "ClientID=" + clientID + "&Command=10";
RasHttpRequest request = new RasHttpRequest();
if(((RasTransaction)this.currentTransaction()).isOpenLocally()) // TA is open, we can proceed
// (decide w/o asking server -- PB 2003-jun-25)
{
// get new oid
try
{
request.execute(rasServer,params); // get it from server
}
catch(RasQueryExecutionFailedException e)
{
// this cannot occur (theoretically)
Debug.talkCritical( "RasODMGImplementation.getObjectId: query execution failed: " + e.getMessage() );
}
}
else // TA is not open, so we do an open here
{
Debug.talkSparse( "RasODMGImplementation.getObjectId: db not open, opening: " + databaseName + "." );
boolean openedDbHere = false; // did we open a db locally?
boolean openedTaHere = false; // did we open a db locally?
Database d = null;
Transaction t = null;
try
{
if(this.dbIsOpen == Database.NOT_OPEN) // we even open the db if not done already
{
Debug.talkSparse( "RasODMGImplementation.getObjectId: db not open, opening: " + databaseName + "." );
d = this.newDatabase();
d.open( databaseName, Database.OPEN_READ_WRITE);
// fix: was: "RASBASE"; now: take name of last opened db. not good, but better maybe -- PB 2003-jun-13
// FIXME: r/w open not good, do we have info at this point? Maybe getOid needs r/w
openedDbHere = true;
}
t = this.newTransaction();
t.begin();
openedTaHere = true; // we know now we have an open TA
// get new oid
request.execute(rasServer,params); // get it from server
t.commit();
if(openedDbHere)
{
Debug.talkSparse( "RasODMGImplementation.getObjectId: closing locally opened DB. " );
d.close();
openedDbHere = false; // no more locally opened DB to close
}
}
catch(ODMGException e)
{
Debug.talkCritical( "RasODMGImplementation.getObjectId: failed: " + e.getMessage() );
try
{
if (openedTaHere)
t.abort();
if(openedDbHere)
d.close();
}
catch (ODMGException e3)
{
Debug.talkSparse( "RasODMGImplementation.getObjectId: error closing locally opened DB (ignored): " + e3.getMessage() );
}
}
} // if (TA open)
resultBag = (DBag)request.getResult(); // if all went fine we now have OID in result
if(resultBag != null)
{
Iterator iter = resultBag.iterator();
if(iter.hasNext())
roid = (RasOID)iter.next();
oid = roid.toString();
((RasObject)obj).setOID(roid);
}
else
{
Debug.talkCritical( "RasODMGImplementation.getObjectId: empty query result, cannot fetch OID." );
oid = null;
}
} // valid OID
Debug.leaveVerbose( "RasODMGImplementation.getObjectId: done. oid=" + oid + "." );
return oid;
} // getObjectId()
/**
* Not implemented yet.
*/
public Database getDatabase(Object obj)
{
Debug.talkCritical( "RasODMGImplementation.getDatabase: not yet implemented." );
throw new NotImplementedException();
}
/**
* Open database
*/
public void openDB(String name, int accessMode) throws ODMGException, ODMGRuntimeException
{
Debug.enterVerbose( "RasODMGImplementation.openDB: start, db=" + name + ", accessMode=" + accessMode );
databaseName = name;
this.accessMode = accessMode;
try
{
getFreeServer(); // sets rasServer
executeOpenDB(databaseName,accessMode);
// executeCloseDB(); // does nothing, so clean away -- PB 2003-jun-25
dbIsOpen = 1;
}
catch (ODMGException e) // catch just for logging, then rethrow immediately
{
Debug.leaveCritical( "RasODMGImplementation.openDB: done. Exception: " + e.getMessage() );
throw new ODMGException( e.getMessage() );
}
catch (ODMGRuntimeException x) // catch just for logging, then rethrow immediately
{
Debug.leaveCritical( "RasODMGImplementation.openDB: done. ODMGRuntimeException: " + x.getMessage() );
throw new ODMGException( x.getMessage() );
}
Debug.leaveVerbose( "RasODMGImplementation.openDB: done. OK." );
}
private void executeOpenDB(String name, int accessMode) throws ODMGException
{
Debug.enterVerbose( "RasODMGImplementation.executeOpenDB: start, name=" + name + ", accessMode=" + accessMode );
String params = "Command=" + RasODMGGlobal.commOpenDB + "&Database=" + name + "&Capability=" + capability;
RasHttpRequest request = new RasHttpRequest();
request.execute(rasServer,params);
// Later, the client ID is determined here
clientID = 1; // not used anymore
Debug.leaveVerbose( "RasODMGImplementation.executeOpenDB: done." );
}
/**
* Closes an open database. At the moment, only one database can be open at
* a given time and thus no parameter "database" is necessary here.
*/
public void closeDB() throws ODMGException
{
Debug.enterVerbose( "RasODMGImplementation.closeDB start." );
// not necessary, others do close already
// PB: this is due to an old bug in O2 which needed a closeDB in order to free objects, hence we do this in commitTA/abortTA
dbIsOpen = 0;
Debug.leaveVerbose( "RasODMGImplementation.closeDB done." );
}
private void executeCloseDB() throws ODMGException
{
String params = "ClientID=" + clientID + "&Command=" + RasODMGGlobal.commCloseDB;
RasHttpRequest request = new RasHttpRequest();
request.execute(rasServer,params);
}
/**
* Begin a transaction.
*/
public void beginTA()
{
Debug.enterVerbose( "RasODMGImplementation.beginTA start." );
// exception handling deactivated, as not thrown any longer -- PB 2004-jul-03
// try
// {
// this hurts in several ways, so deactivated it: -- PB 2004-jul-03
// - "getFreeServer();executeOpenDB();" done in openDB(). ODMG says: to begin a TA DB must be open
// - this sucks up an additional server process for clean clients doing "openDB();beginTA()"
// getFreeServer();
// executeOpenDB(databaseName,accessMode);
executeBeginTA();
// }
// catch(ODMGException e)
// {
// Debug.talkWarning( "RasODMGImplementation.beginTA: " + e.getMessage() );
// errorStatus = e.getMessage();
// }
Debug.leaveVerbose( "RasODMGImplementation.beginTA done." );
}
private void executeBeginTA()
{
String errorMsg = "Could not open transaction: ";
if(dbIsOpen == 0)
throw new DatabaseClosedException(errorMsg + "database not open");
String params = "ClientID=" + clientID + "&Command=";
// Is the database opened READ_ONLY or READ_WRITE ?
if(accessMode == Database.OPEN_READ_ONLY)
params = params + RasODMGGlobal.commBTreadOnly;
else
params = params + RasODMGGlobal.commBTreadWrite;
params = params + "&Capability=" + capability;
RasHttpRequest request = new RasHttpRequest();
try
{
request.execute(rasServer,params);
}
catch(RasQueryExecutionFailedException e)
{
// this cannot occur (theoretically)
Debug.talkWarning( "RasODMGImplementation.executeBeginTA: " + e.getMessage() );
errorStatus = e.getMessage();
}
}
/**
* 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)
*/
public boolean isOpenTA()
{
Debug.enterVerbose( "RasODMGImplementation.isOpenTA start." );
boolean result = false;
String params = "ClientID=" + clientID + "&Command=" + RasODMGGlobal.commIsOpenTA;
RasHttpRequest request = new RasHttpRequest();
try
{
request.execute(rasServer,params);
result= (request.getResultType() == 99) ? true : false;
}
catch(RasQueryExecutionFailedException e)
{
// this cannot occur (theoretically)
Debug.talkWarning( "RasODMGImplementation.isOpenTA: " + e.getMessage() );
errorStatus = e.getMessage();
result = false;
}
Debug.leaveVerbose( "RasODMGImplementation.isOpenTA done. result=" + result );
return result;
}
/**
* Commit a transaction.
*/
public void commitTA()
{
Debug.enterVerbose( "RasODMGImplementation.commitTA start." );
try
{
executeCommitTA();
executeCloseDB(); // FIXME: why close here??? -- PB 2003-jun-13
}
catch(ODMGException e)
{
Debug.talkWarning( "RasODMGImplementation.commitTA: " + e.getMessage() );
errorStatus = e.getMessage();
}
Debug.leaveVerbose( "RasODMGImplementation.commitTA done." );
}
private void executeCommitTA()
{
String errorMsg = "Could not commit transaction: ";
if(dbIsOpen == 0)
throw new DatabaseClosedException(errorMsg + "database not open");
String params = "ClientID=" + clientID + "&Command=" + RasODMGGlobal.commCT;
RasHttpRequest request = new RasHttpRequest();
try
{
request.execute(rasServer,params);//RasODMGGlobal.getRasServer(),params);
}
catch(RasQueryExecutionFailedException e)
{
// this cannot occur (theoretically)
Debug.talkWarning( "RasODMGImplementation.executeCommitTA: " + e.getMessage() );
errorStatus = e.getMessage();
}
}
/**
* Abort a transaction.
*/
public void abortTA()
{
Debug.enterVerbose( "RasODMGImplementation.abortTA start." );
try
{
executeAbortTA();
executeCloseDB();
}
catch(ODMGException e)
{
Debug.talkWarning( "RasODMGImplementation.abortTA: " + e.getMessage() );
errorStatus = e.getMessage();
}
Debug.leaveVerbose( "RasODMGImplementation.abortTA done." );
}
private void executeAbortTA()
{
String errorMsg = "Cannot abort transaction: ";
if(dbIsOpen == 0)
throw new DatabaseClosedException(errorMsg + "database not open");
String params = "ClientID=" + clientID + "&Command=" + RasODMGGlobal.commAT;
RasHttpRequest request = new RasHttpRequest();
try
{
request.execute(rasServer,params);
}
catch(RasQueryExecutionFailedException e)
{
// this cannot occur (theoretically)
Debug.talkWarning( "RasODMGImplementation.executeAbortTA: " + e.getMessage() );
errorStatus = e.getMessage();
}
}
/**
* Set the maximum retry parameter
*/
public void setMaxRetry(int newRetry)
{
Debug.talkVerbose( "RasODMGImplementation.setMaxRetry to " + newRetry + "." );
maxRetry = newRetry;
}
/**
* Get the maximum retry parameter
*/
public int getMaxRetry()
{
Debug.talkVerbose( "RasODMGImplementation.getMaxRetry: maxRetry=" + maxRetry + "." );
return maxRetry;
}
/**
* Requests a free server and retry's
*/
//private void getFreeServer( )
public void getFreeServer( )
throws RasQueryExecutionFailedException, RasConnectionFailedException
{
Debug.enterVerbose( "RasODMGImplementation.getFreeServer: start." );
String uniqueID = uniqueRequestID();
int millisec = RasGlobalDefs.GETFREESERVER_WAIT_INITIAL;
for (int retryCount = 1; retryCount <= maxRetry; retryCount++)
{
try
{
executeGetFreeServer(uniqueID);
// if no error, we have the server, so break
break;
}
catch(RasConnectionFailedException e)
{
Debug.talkCritical( "RasODMGImplementation.getFreeServer: cannot obtain a free server:" + e.getMessage() );
// the following errors justify that we try again, maybe we get a free server a little later
int errno = e.getErrorNo();
if (errno==RasGlobalDefs.MANAGER_BUSY
/* || errno==RasGlobalDefs.NO_ACTIVE_SERVERS */ // if no such server is started, waiting won't help
|| errno==RasGlobalDefs.WRITE_TRANS_IN_PROGRESS)
{
// retry, but with increasing wait period
millisec = millisec * RasGlobalDefs.GETFREESERVER_WAIT_INCREMENT;
Debug.talkCritical( "RasODMGImplementation.getFreeServer: no free server available, errno=" + errno + ", retry #" + retryCount + " of " + maxRetry + " after " + millisec + " msecs." );
try
{
Thread.sleep(millisec);
}
catch(InterruptedException intex)
{ // wake up
}
}
else
{
Debug.talkCritical( "RasODMGImplementation.getFreeServer: giving up, cannot obtain free server. marking connection as closed." );
Debug.leaveVerbose( "RasODMGImplementation.getFreeServer: done." );
// reset ta & db
isOpenTA = false;
dbIsOpen = 0;
throw(e); // we give up, or we shouldn't retry with this kind of error
}
}
} // for
Debug.leaveVerbose( "RasODMGImplementation.getFreeServer: done." );
}
/**
* Requests a free server from rasmgr
*/
private void executeGetFreeServer( String uniqueID ) throws RasQueryExecutionFailedException, RasConnectionFailedException
{
Debug.enterVerbose( "RasODMGImplementation.executeGetFreeServer: enter, uniqueID=" + uniqueID );
try
{
Socket soclu = new Socket(rasMgr,rasMgrPort); // FIXME: where is this socket closed ??? PB
Debug.talkVerbose( "RasODMGImplementation.executeGetFreeServer: socket=" + soclu );
PrintStream ps = new PrintStream(soclu.getOutputStream());
String body = databaseName + " HTTP " + (accessMode == Database.OPEN_READ_ONLY ? "ro":"rw") + " " + uniqueID + " \0";
ps.print("POST getfreeserver HTTP/1.1\r\nAccept: text/plain\r\nContent-type: text/plain\r\n"
+ "User-Agent: RasDaMan Java Client1.0\r\nAuthorization: ras " + userIdentification
+ "\r\nContent length: " + body.length()+"\r\n\r\n" + body);
ps.flush();
Debug.talkVerbose( "RasODMGImplementation.executeGetFreeServer: sent body=" + body );
BufferedReader ds = new BufferedReader(new InputStreamReader(soclu.getInputStream()));
int resultCode = getResultCode(ds);
String bodyLine = getBodyLine(ds);
Debug.talkVerbose( "RasODMGImplementation.executeGetFreeServer: received result code=" + resultCode + ", bodyLine=" + bodyLine );
ps.close();
ds.close();
soclu.close(); // this one was missing all the time -- PB
Debug.talkVerbose( "RasODMGImplementation.executeGetFreeServer: socket closed: " + soclu );
if(resultCode==200)
{
StringTokenizer t=new StringTokenizer(bodyLine," ");
String host=t.nextToken();
String port=t.nextToken(" ");
capability=t.nextToken(" \t\r\n\0");
rasServer="http://" + host + ":" + port;
}
else
{
// if error =>bodyLine: errorCode someText
Debug.talkSparse( "RasODMGImplementation.executeGetFreeServer: bodyLine=" + bodyLine);
StringTokenizer t=new StringTokenizer(bodyLine," ");
String errorStr = t.nextToken();
int errorCode = Integer.parseInt(errorStr);
if( resultCode < 1000 )
{
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer: done. connection failed, code=" + errorCode );
throw new RasConnectionFailedException(errorCode,null);
}
else
{
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer: done. request format error, code=" + errorCode );
throw new RasConnectionFailedException(RasGlobalDefs.REQUEST_FORMAT_ERROR," code=" + errorCode);
}
}
}
catch( MalformedURLException e )
{
Debug.talkCritical( "RasODMGImplementation.executeGetFreeServer: malformed URL exception: " + e.getMessage() );
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer: done with exception: " + e.getMessage() );
throw new RasConnectionFailedException(RasGlobalDefs.MANAGER_CONN_FAILED,rasMgr);
}
catch( IOException e )
{
Debug.talkCritical( "RasODMGImplementation.executeGetFreeServer: IO exception: " + e.getMessage() );
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer: done with exception: " + e.getMessage() );
throw new RasClientInternalException( "RasODMGImplementation","executeGetFreeServer()", e.getMessage() );
}
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer: done." );
} // executeGetFreeServer()
public Object queryRequest(String parameters) throws RasQueryExecutionFailedException
{
Debug.enterVerbose( "RasODMGImplementation.queryRequest start. parameters=" + parameters + "." );
BenchmarkTimer qTimer = new BenchmarkTimer("queryRequest");
qTimer.startTimer();
RasHttpRequest request= new RasHttpRequest();
request.execute(rasServer,parameters);
qTimer.stopTimer();
qTimer.print();
Debug.leaveVerbose( "RasODMGImplementation.executeGetFreeServer done." );
return request.getResult();
}
//private int getResultCode(BufferedReader ds) throws IOException
public int getResultCode(BufferedReader ds) throws IOException
{
Debug.enterVerbose( "RasODMGImplementation.getResultCode start." );
String s = ds.readLine();
StringTokenizer t = new StringTokenizer(s," ");
String http = t.nextToken();
String resultString = t.nextToken(" ");
int result = Integer.parseInt(resultString);
Debug.leaveVerbose( "RasODMGImplementation.getResultCode done. result=" + result + "." );
return result;
}
//private String getBodyLine(BufferedReader ds) throws IOException
public String getBodyLine(BufferedReader ds) throws IOException
{
Debug.enterVerbose( "RasODMGImplementation.getBodyLine start." );
String s;
do // was a "for(;;)" loop, cleaned it -- PB 2003-jun-13
{
s = ds.readLine();
if(s==null)
{
Debug.talkCritical( "RasODMGImplementation.getBodyLine: Unexpected EOF in rasmgr answer." );
throw new IOException("Unexpected EOF in rasmgr answer.");
}
}
while (s.length() != 0);
String result = ds.readLine();
Debug.leaveVerbose( "RasODMGImplementation.getBodyLine done. result=" + result + "." );
return result;
}
public void setUserIdentification(String userName, String plainPass)
{
Debug.enterVerbose( "RasODMGImplementation.setUserIdentification start." );
MD5 md5 = new MD5();
String hex;
md5.Init();
md5.Update(plainPass);
hex = md5.asHex();
userIdentification= userName + ":" + hex;
Debug.leaveVerbose( "RasODMGImplementation.setUserIdentification done." );
}
private String strHostID = null;
static private int idcounter = 0;
private String uniqueRequestID()
{
Debug.enterVerbose( "RasODMGImplementation.uniqueRequestID start." );
if(strHostID == null)
{
long hostid = 0;
try
{
InetAddress addr = InetAddress.getLocalHost();
// Get IP Address
byte[] ipAddr = addr.getAddress();
for(int i=0;i