1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-19 22:25:52 +02:00

removing dstore compiler warnings

This commit is contained in:
David McKnight 2006-11-28 17:12:01 +00:00
parent ba9a89c968
commit 9231857606
40 changed files with 662 additions and 691 deletions

View file

@ -38,16 +38,16 @@ public class ClientAttributes extends DataStoreAttributes
try try
{ {
String pluginPath = System.getProperty("A_PLUGIN_PATH"); String pluginPath = System.getProperty("A_PLUGIN_PATH"); //$NON-NLS-1$
if ((pluginPath != null) && (pluginPath.length() > 0)) if ((pluginPath != null) && (pluginPath.length() > 0))
{ {
setAttribute(A_PLUGIN_PATH, pluginPath + File.separator); setAttribute(A_PLUGIN_PATH, pluginPath + File.separator);
} }
setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName()); setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName());
setAttribute(A_LOCAL_PATH, "/tmp/"); setAttribute(A_LOCAL_PATH, "/tmp/"); //$NON-NLS-1$
setAttribute(A_HOST_NAME, "local"); setAttribute(A_HOST_NAME, "local"); //$NON-NLS-1$
setAttribute(A_HOST_PATH, "/"); setAttribute(A_HOST_PATH, "/"); //$NON-NLS-1$
} }
catch (UnknownHostException e) catch (UnknownHostException e)

View file

@ -42,73 +42,73 @@ public class ClientCommandHandler extends CommandHandler
private static String[] _docAttributes = { private static String[] _docAttributes = {
DataStoreResources.DOCUMENT_TYPE, DataStoreResources.DOCUMENT_TYPE,
"client.doc.root.id", "client.doc.root.id", //$NON-NLS-1$
"client.document", "client.document", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _fileAttributes = { private static String[] _fileAttributes = {
DataStoreResources.FILE_TYPE, DataStoreResources.FILE_TYPE,
"client.file.root.id", "client.file.root.id", //$NON-NLS-1$
"client.file", "client.file", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _classAttributes = { private static String[] _classAttributes = {
DataStoreResources.CLASS_TYPE, DataStoreResources.CLASS_TYPE,
"client.class.root.id", "client.class.root.id", //$NON-NLS-1$
"client.class", "client.class", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _serializeAttributes = { private static String[] _serializeAttributes = {
DataStoreResources.SERIALIZED_TYPE, DataStoreResources.SERIALIZED_TYPE,
"client.serialized.root.id", "client.serialized.root.id", //$NON-NLS-1$
"client.serialized", "client.serialized", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _requestClassAttributes = { private static String[] _requestClassAttributes = {
DataStoreResources.REQUEST_CLASS_TYPE, DataStoreResources.REQUEST_CLASS_TYPE,
"client.requestclass.root.id", "client.requestclass.root.id", //$NON-NLS-1$
"client.requestclass", "client.requestclass", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _keepAliveAttributes = { private static String[] _keepAliveAttributes = {
DataStoreResources.KEEPALIVE_TYPE, DataStoreResources.KEEPALIVE_TYPE,
"client.keepalive.root.id", "client.keepalive.root.id", //$NON-NLS-1$
"server.keepalive", "server.keepalive", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _confirmKeepAliveAttributes = { private static String[] _confirmKeepAliveAttributes = {
DataStoreResources.KEEPALIVECONFIRM_TYPE, DataStoreResources.KEEPALIVECONFIRM_TYPE,
"client.keepalive.confirm.root.id", "client.keepalive.confirm.root.id", //$NON-NLS-1$
"server.confirmkeepalive", "server.confirmkeepalive", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
protected DataElement _fileDocumentElement; protected DataElement _fileDocumentElement;
@ -170,7 +170,7 @@ public class ClientCommandHandler extends CommandHandler
*/ */
public synchronized void sendFile(String fileName, byte[] bytes, int size, boolean binary) public synchronized void sendFile(String fileName, byte[] bytes, int size, boolean binary)
{ {
sendFile(fileName, bytes, size, binary, "default"); sendFile(fileName, bytes, size, binary, "default"); //$NON-NLS-1$
} }
/** /**
@ -206,7 +206,7 @@ public class ClientCommandHandler extends CommandHandler
*/ */
public synchronized void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary) public synchronized void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary)
{ {
sendAppendFile(fileName, bytes, size, binary, "default"); sendAppendFile(fileName, bytes, size, binary, "default"); //$NON-NLS-1$
} }
/** /**
@ -295,7 +295,7 @@ public class ClientCommandHandler extends CommandHandler
*/ */
public synchronized void sendClass(String className) public synchronized void sendClass(String className)
{ {
sendClass(className, "default"); sendClass(className, "default"); //$NON-NLS-1$
} }
/** /**
@ -353,8 +353,8 @@ public class ClientCommandHandler extends CommandHandler
{ {
DataElement document = _confirmKeepAliveDocumentElement; DataElement document = _confirmKeepAliveDocumentElement;
document.setPendingTransfer(true); document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "confirm"); document.setAttribute(DE.A_NAME, "confirm"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "confirm"); document.setAttribute(DE.A_VALUE, "confirm"); //$NON-NLS-1$
document.setParent(null); document.setParent(null);
_pendingKeepAliveConfirmation = document; _pendingKeepAliveConfirmation = document;
notifyInput(); notifyInput();
@ -364,8 +364,8 @@ public class ClientCommandHandler extends CommandHandler
{ {
DataElement document = _keepAliveDocumentElement; DataElement document = _keepAliveDocumentElement;
document.setPendingTransfer(true); document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "request"); document.setAttribute(DE.A_NAME, "request"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "request"); document.setAttribute(DE.A_VALUE, "request"); //$NON-NLS-1$
document.setParent(null); document.setParent(null);
_pendingKeepAliveRequest = document; _pendingKeepAliveRequest = document;
notifyInput(); notifyInput();

View file

@ -111,12 +111,12 @@ public class ClientConnection implements IDataStoreConstants
private static final int VERSION_INDEX_PROTOCOL = 0; private static final int VERSION_INDEX_PROTOCOL = 0;
private static final int VERSION_INDEX_VERSION = 1; private static final int VERSION_INDEX_VERSION = 1;
private static final int VERSION_INDEX_MINOR = 2; private static final int VERSION_INDEX_MINOR = 2;
public static String INCOMPATIBLE_SERVER_UPDATE = "Incompatible DataStore."; public static String INCOMPATIBLE_SERVER_UPDATE = "Incompatible DataStore."; //$NON-NLS-1$
public static String INCOMPATIBLE_CLIENT_UPDATE = "Incompatible DataStore."; public static String INCOMPATIBLE_CLIENT_UPDATE = "Incompatible DataStore."; //$NON-NLS-1$
public static String SERVER_OLDER = "Older DataStore Server."; public static String SERVER_OLDER = "Older DataStore Server."; //$NON-NLS-1$
public static String CLIENT_OLDER = "Older DataStore Client."; public static String CLIENT_OLDER = "Older DataStore Client."; //$NON-NLS-1$
public static String INCOMPATIBLE_PROTOCOL = "Incompatible Protocol."; public static String INCOMPATIBLE_PROTOCOL = "Incompatible Protocol."; //$NON-NLS-1$
public static String CANNOT_CONNECT = "Cannot connect to server."; public static String CANNOT_CONNECT = "Cannot connect to server."; //$NON-NLS-1$
/** /**
* Creates a new ClientConnection instance * Creates a new ClientConnection instance
@ -242,7 +242,7 @@ public class ClientConnection implements IDataStoreConstants
{ {
if (port == null || port.length() == 0) if (port == null || port.length() == 0)
{ {
port = "0"; port = "0"; //$NON-NLS-1$
} }
_port = port; _port = port;
@ -317,7 +317,7 @@ public class ClientConnection implements IDataStoreConstants
if (_isRemote) if (_isRemote)
{ {
_commandHandler.command( _commandHandler.command(
_dataStore.find(_dataStore.getRoot(), DE.A_NAME, "Exit"), _dataStore.find(_dataStore.getRoot(), DE.A_NAME, "Exit"), //$NON-NLS-1$
_dataStore.getHostRoot(), _dataStore.getHostRoot(),
false); false);
_receiver.finish(); _receiver.finish();
@ -354,7 +354,7 @@ public class ClientConnection implements IDataStoreConstants
if (_loaders == null) if (_loaders == null)
{ {
_loaders = new ArrayList(); _loaders = new ArrayList();
_loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); _loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); //$NON-NLS-1$
} }
_commandHandler = new ServerCommandHandler(_loaders); _commandHandler = new ServerCommandHandler(_loaders);
@ -380,7 +380,7 @@ public class ClientConnection implements IDataStoreConstants
_isConnected = true; _isConnected = true;
DataElement ticket = _dataStore.getTicket(); DataElement ticket = _dataStore.getTicket();
ticket.setAttribute(DE.A_NAME, "null"); ticket.setAttribute(DE.A_NAME, "null"); //$NON-NLS-1$
ConnectionStatus result = new ConnectionStatus(_isConnected); ConnectionStatus result = new ConnectionStatus(_isConnected);
result.setTicket(ticket.getName()); result.setTicket(ticket.getName());
@ -411,7 +411,7 @@ public class ClientConnection implements IDataStoreConstants
else else
{ {
launchStatus = new ConnectionStatus(true); launchStatus = new ConnectionStatus(true);
launchStatus.setTicket("null"); launchStatus.setTicket("null"); //$NON-NLS-1$
} }
return connect(launchStatus.getTicket()); return connect(launchStatus.getTicket());
@ -472,7 +472,7 @@ public class ClientConnection implements IDataStoreConstants
{ {
((SSLSocket) _theSocket).startHandshake(); ((SSLSocket) _theSocket).startHandshake();
SSLSession session = ((SSLSocket) _theSocket).getSession(); ((SSLSocket) _theSocket).getSession();
} }
catch (SSLHandshakeException e) catch (SSLHandshakeException e)
@ -507,44 +507,44 @@ public class ClientConnection implements IDataStoreConstants
case HANDSHAKE_SERVER_NEWER: case HANDSHAKE_SERVER_NEWER:
{ {
msg = INCOMPATIBLE_CLIENT_UPDATE; msg = INCOMPATIBLE_CLIENT_UPDATE;
msg += "\nThe server running on " msg += "\nThe server running on " //$NON-NLS-1$
+ _host + _host
+ " under port " + " under port " //$NON-NLS-1$
+ _port + _port
+ " is a newer DataStore server."; + " is a newer DataStore server."; //$NON-NLS-1$
break; break;
} }
case HANDSHAKE_SERVER_OLDER: case HANDSHAKE_SERVER_OLDER:
{ {
msg = INCOMPATIBLE_SERVER_UPDATE; msg = INCOMPATIBLE_SERVER_UPDATE;
msg += "\nThe server running on " msg += "\nThe server running on " //$NON-NLS-1$
+ _host + _host
+ " under port " + " under port " //$NON-NLS-1$
+ _port + _port
+ " is an older DataStore server."; + " is an older DataStore server."; //$NON-NLS-1$
break; break;
} }
case HANDSHAKE_INCORRECT: case HANDSHAKE_INCORRECT:
{ {
msg = CANNOT_CONNECT; msg = CANNOT_CONNECT;
msg += INCOMPATIBLE_PROTOCOL; msg += INCOMPATIBLE_PROTOCOL;
msg += "\nThe server running on " msg += "\nThe server running on " //$NON-NLS-1$
+ _host + _host
+ " under port " + " under port " //$NON-NLS-1$
+ _port + _port
+ " is not a valid DataStore server."; + " is not a valid DataStore server."; //$NON-NLS-1$
break; break;
} }
case HANDSHAKE_UNEXPECTED: case HANDSHAKE_UNEXPECTED:
{ {
msg = CANNOT_CONNECT; msg = CANNOT_CONNECT;
msg += "Unexpected exception."; msg += "Unexpected exception."; //$NON-NLS-1$
break; break;
} }
case HANDSHAKE_TIMEOUT: case HANDSHAKE_TIMEOUT:
{ {
msg = CANNOT_CONNECT; msg = CANNOT_CONNECT;
msg += "Timeout waiting for socket activity."; msg += "Timeout waiting for socket activity."; //$NON-NLS-1$
break; break;
} }
default: default:
@ -560,8 +560,8 @@ public class ClientConnection implements IDataStoreConstants
} }
catch (java.net.ConnectException e) catch (java.net.ConnectException e)
{ {
String msg = "Connection Refused."; String msg = "Connection Refused."; //$NON-NLS-1$
msg += "\nMake sure that the DataStore server is running on " + _host + " under port " + _port + "."; msg += "\nMake sure that the DataStore server is running on " + _host + " under port " + _port + "."; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
result = new ConnectionStatus(false, msg); result = new ConnectionStatus(false, msg);
} }
catch (UnknownHostException uhe) catch (UnknownHostException uhe)
@ -673,7 +673,7 @@ public class ClientConnection implements IDataStoreConstants
} }
else if (status == null) else if (status == null)
{ {
Exception e = new Exception("no status returned"); Exception e = new Exception("no status returned"); //$NON-NLS-1$
result = new ConnectionStatus(false, e); result = new ConnectionStatus(false, e);
} }
else else
@ -771,8 +771,8 @@ public class ClientConnection implements IDataStoreConstants
} }
catch (java.net.ConnectException e) catch (java.net.ConnectException e)
{ {
String msg = "Connection Refused."; String msg = "Connection Refused."; //$NON-NLS-1$
msg += "\nMake sure that the DataStore daemon is running on " + _host + "."; msg += "\nMake sure that the DataStore daemon is running on " + _host + "."; //$NON-NLS-1$ //$NON-NLS-2$
result = new ConnectionStatus(false, msg); result = new ConnectionStatus(false, msg);
} }
catch (UnknownHostException uhe) catch (UnknownHostException uhe)
@ -825,18 +825,6 @@ public class ClientConnection implements IDataStoreConstants
_port = _clientAttributes.getAttribute(DataStoreAttributes.A_HOST_PORT); _port = _clientAttributes.getAttribute(DataStoreAttributes.A_HOST_PORT);
} }
private void flush(DataElement object)
{
_dataStore.flush(object);
}
private void flush()
{
_dataStore.flush(_dataStore.getHostRoot());
_dataStore.flush(_dataStore.getLogRoot());
_dataStore.flush(_dataStore.getDescriptorRoot());
_dataStore.createRoot();
}
private int doHandShake() private int doHandShake()
{ {
@ -844,9 +832,9 @@ public class ClientConnection implements IDataStoreConstants
{ {
BufferedReader reader = new BufferedReader(new InputStreamReader(_theSocket.getInputStream(), DE.ENCODING_UTF_8)); BufferedReader reader = new BufferedReader(new InputStreamReader(_theSocket.getInputStream(), DE.ENCODING_UTF_8));
PrintWriter writer = new PrintWriter(new OutputStreamWriter(_theSocket.getOutputStream(), DE.ENCODING_UTF_8)); PrintWriter writer = new PrintWriter(new OutputStreamWriter(_theSocket.getOutputStream(), DE.ENCODING_UTF_8));
writer.println(""); writer.println(""); //$NON-NLS-1$
writer.println(""); writer.println(""); //$NON-NLS-1$
writer.println(""); writer.println(""); //$NON-NLS-1$
writer.flush(); writer.flush();
String handshake = null; String handshake = null;
@ -860,8 +848,8 @@ public class ClientConnection implements IDataStoreConstants
} }
_theSocket.setSoTimeout(0); _theSocket.setSoTimeout(0);
String[] clientVersionStr = DataStoreAttributes.DATASTORE_VERSION.split("\\."); String[] clientVersionStr = DataStoreAttributes.DATASTORE_VERSION.split("\\."); //$NON-NLS-1$
String[] serverVersionStr = handshake.split("\\."); String[] serverVersionStr = handshake.split("\\."); //$NON-NLS-1$
_dataStore.setServerVersion(Integer.parseInt(serverVersionStr[VERSION_INDEX_VERSION])); _dataStore.setServerVersion(Integer.parseInt(serverVersionStr[VERSION_INDEX_VERSION]));
_dataStore.setServerMinor(Integer.parseInt(serverVersionStr[VERSION_INDEX_MINOR])); _dataStore.setServerMinor(Integer.parseInt(serverVersionStr[VERSION_INDEX_MINOR]));
@ -873,7 +861,7 @@ public class ClientConnection implements IDataStoreConstants
} }
else else
{ {
if (handshake.startsWith("<DataElement")) if (handshake.startsWith("<DataElement")) //$NON-NLS-1$
{ {
return HANDSHAKE_SERVER_OLDER; return HANDSHAKE_SERVER_OLDER;
} }

View file

@ -44,7 +44,7 @@ public class ClientReceiver extends Receiver
*/ */
public void handleDocument(DataElement documentObject) public void handleDocument(DataElement documentObject)
{ {
if (documentObject.getName().equals("exit")) if (documentObject.getName().equals("exit")) //$NON-NLS-1$
{ {
_canExit = true; _canExit = true;
} }

View file

@ -88,7 +88,6 @@ public class ClientUpdateHandler extends UpdateHandler
{ {
if (_dataStore != null && !isFinished()) if (_dataStore != null && !isFinished())
{ {
IDomainNotifier notifier = _dataStore.getDomainNotifier();
while (_dataObjects.size() > 0) while (_dataObjects.size() > 0)
{ {
DataElement object = null; DataElement object = null;

View file

@ -43,7 +43,7 @@ public class ClassByteStreamHandler implements IClassByteStreamHandler
protected DataStore _dataStore; protected DataStore _dataStore;
protected DataElement _log; protected DataElement _log;
protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; //$NON-NLS-1$
/** /**
* Contructor * Contructor

View file

@ -93,7 +93,7 @@ import org.eclipse.dstore.core.model.DataStore;
*/ */
public class RemoteClassLoader extends ClassLoader public class RemoteClassLoader extends ClassLoader
{ {
public static String CACHING_PREFERENCE = "Class.Caching"; public static String CACHING_PREFERENCE = "Class.Caching"; //$NON-NLS-1$
private DataStore _dataStore; private DataStore _dataStore;
private boolean _useCaching = false; private boolean _useCaching = false;
private CacheClassLoader _urlClassLoader; private CacheClassLoader _urlClassLoader;
@ -128,7 +128,7 @@ public class RemoteClassLoader extends ClassLoader
{ {
boolean useCaching = false; boolean useCaching = false;
String pref = _dataStore.getPreference(CACHING_PREFERENCE); String pref = _dataStore.getPreference(CACHING_PREFERENCE);
if (pref != null && pref.equals("true")) if (pref != null && pref.equals("true")) //$NON-NLS-1$
{ {
useCaching = true; useCaching = true;
} }
@ -287,6 +287,7 @@ public class RemoteClassLoader extends ClassLoader
// this is the signal that the class could not be found on the client // this is the signal that the class could not be found on the client
// System.out.println("Empty class/class not found: "+className); // System.out.println("Empty class/class not found: "+className);
// System.out.println("notifying requester"); // System.out.println("notifying requester");
if (request != null)
request.notifyResponse(); // wake up the threads waiting for the class request.notifyResponse(); // wake up the threads waiting for the class
return; return;
} }
@ -308,6 +309,7 @@ public class RemoteClassLoader extends ClassLoader
// (even after requesting it from the client). We must fail, // (even after requesting it from the client). We must fail,
// but wake up the threads waiting for this class. // but wake up the threads waiting for this class.
e.printStackTrace(); e.printStackTrace();
if (request != null)
request.notifyResponse(); request.notifyResponse();
return; return;
} }
@ -327,12 +329,14 @@ public class RemoteClassLoader extends ClassLoader
// so we might as well just fail here and notify threads waiting // so we might as well just fail here and notify threads waiting
// for this class to load. // for this class to load.
err.printStackTrace(); err.printStackTrace();
if (request != null)
request.notifyResponse(); request.notifyResponse();
return; return;
} }
catch (ClassNotFoundException ee) catch (ClassNotFoundException ee)
{ {
// we definitely shouldnt get here // we definitely shouldnt get here
if (request != null)
request.notifyResponse(); request.notifyResponse();
return; return;
} }
@ -341,6 +345,7 @@ public class RemoteClassLoader extends ClassLoader
// we still dont have it, notify the threads and fail. // we still dont have it, notify the threads and fail.
if (receivedClass == null) if (receivedClass == null)
{ {
if (request != null)
request.notifyResponse(); request.notifyResponse();
return; return;
} }

View file

@ -190,7 +190,7 @@ implements ISchemaExtender
if (_value == null) if (_value == null)
{ {
String name = getMinerName(); String name = getMinerName();
int indexOfValue = name.lastIndexOf("."); int indexOfValue = name.lastIndexOf("."); //$NON-NLS-1$
_value = name.substring(indexOfValue + 1, name.length()); _value = name.substring(indexOfValue + 1, name.length());
} }
return _value; return _value;
@ -256,17 +256,16 @@ implements ISchemaExtender
{ {
String name = getCommandName(command); String name = getCommandName(command);
DataElement status = getCommandStatus(command); DataElement status = getCommandStatus(command);
long startTime = System.currentTimeMillis();
if (status == null) if (status == null)
{ {
_dataStore.trace("bad command: "); _dataStore.trace("bad command: "); //$NON-NLS-1$
_dataStore.trace("\tcmd=" + command); _dataStore.trace("\tcmd=" + command); //$NON-NLS-1$
_dataStore.trace("\tparent=" + command.getParent()); _dataStore.trace("\tparent=" + command.getParent()); //$NON-NLS-1$
return null; return null;
} }
if (status.getAttribute(DE.A_NAME).equals("start")) if (status.getAttribute(DE.A_NAME).equals("start")) //$NON-NLS-1$
{ {
status.setAttribute(DE.A_NAME, DataStoreResources.model_working); status.setAttribute(DE.A_NAME, DataStoreResources.model_working);
} }
@ -285,7 +284,7 @@ implements ISchemaExtender
{ {
//e.printStackTrace(); //e.printStackTrace();
_dataStore.trace(e); _dataStore.trace(e);
status.setAttribute(DE.A_VALUE, "Failed with Exception:"+getStack(e)); status.setAttribute(DE.A_VALUE, "Failed with Exception:"+getStack(e)); //$NON-NLS-1$
status.setAttribute(DE.A_NAME, DataStoreResources.model_done); status.setAttribute(DE.A_NAME, DataStoreResources.model_done);
//status.setAttribute(DE.A_SOURCE, getStack(e)); //status.setAttribute(DE.A_SOURCE, getStack(e));
_dataStore.refresh(status); _dataStore.refresh(status);
@ -294,8 +293,8 @@ implements ISchemaExtender
if (e.getMessage() != null) if (e.getMessage() != null)
exc = e.getMessage(); exc = e.getMessage();
else else
exc = "Exception"; exc = "Exception"; //$NON-NLS-1$
DataElement exception = _dataStore.createObject(status, DataStoreResources.model_error, exc); _dataStore.createObject(status, DataStoreResources.model_error, exc);
} }
catch (Error er) catch (Error er)
{ {
@ -316,8 +315,8 @@ implements ISchemaExtender
StackTraceElement[] stack = e.getStackTrace(); StackTraceElement[] stack = e.getStackTrace();
for (int i = 0; i < stack.length; i++) for (int i = 0; i < stack.length; i++)
{ {
buf.append(stack[i].getClassName() + ":" + stack[i].getMethodName() + ":" + stack[i].getLineNumber()); buf.append(stack[i].getClassName() + ":" + stack[i].getMethodName() + ":" + stack[i].getLineNumber()); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(","); buf.append(","); //$NON-NLS-1$
} }
return buf.toString(); return buf.toString();
} }
@ -501,7 +500,7 @@ implements ISchemaExtender
*/ */
public final DataElement createAbstractRelationship(DataElement from, DataElement to) public final DataElement createAbstractRelationship(DataElement from, DataElement to)
{ {
return _dataStore.createReference(from, to, "abstracts", "abstracted by"); return _dataStore.createReference(from, to, "abstracts", "abstracted by"); //$NON-NLS-1$ //$NON-NLS-2$
} }
/** /**

View file

@ -38,7 +38,7 @@ public class ByteStreamHandler implements IByteStreamHandler
protected DataStore _dataStore; protected DataStore _dataStore;
protected DataElement _log; protected DataElement _log;
protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; //$NON-NLS-1$
/** /**
* Contructor * Contructor
@ -118,7 +118,7 @@ public class ByteStreamHandler implements IByteStreamHandler
fileStream.close(); fileStream.close();
if (status == null) if (status == null)
return; return;
status.setAttribute(DE.A_SOURCE, "success"); status.setAttribute(DE.A_SOURCE, "success"); //$NON-NLS-1$
_dataStore.refresh(status.getParent()); _dataStore.refresh(status.getParent());
} }
catch (IOException e) catch (IOException e)
@ -127,7 +127,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null) if (status == null)
return; return;
status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED); status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED);
status.setAttribute(DE.A_SOURCE, "failed"); status.setAttribute(DE.A_SOURCE, "failed"); //$NON-NLS-1$
_dataStore.refresh(status.getParent()); _dataStore.refresh(status.getParent());
} }
catch (Exception e) catch (Exception e)
@ -136,7 +136,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null) if (status == null)
return; return;
status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED); status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED);
status.setAttribute(DE.A_SOURCE, "failed"); status.setAttribute(DE.A_SOURCE, "failed"); //$NON-NLS-1$
_dataStore.refresh(status.getParent()); _dataStore.refresh(status.getParent());
} }
} }
@ -214,7 +214,7 @@ public class ByteStreamHandler implements IByteStreamHandler
} }
if (status == null) if (status == null)
return; return;
status.setAttribute(DE.A_SOURCE, "success"); status.setAttribute(DE.A_SOURCE, "success"); //$NON-NLS-1$
_dataStore.refresh(status.getParent()); _dataStore.refresh(status.getParent());
} }
catch (IOException e) catch (IOException e)
@ -223,7 +223,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null) if (status == null)
return; return;
status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED); status.setAttribute(DE.A_VALUE, FILEMSG_REMOTE_SAVE_FAILED);
status.setAttribute(DE.A_SOURCE, "failed"); status.setAttribute(DE.A_SOURCE, "failed"); //$NON-NLS-1$
_dataStore.refresh(status.getParent()); _dataStore.refresh(status.getParent());
} }
} }

View file

@ -47,7 +47,7 @@ public abstract class CommandHandler extends Handler
public CommandHandler() public CommandHandler()
{ {
super(); super();
setName("DStore CommandHandler"+getName()); setName("DStore CommandHandler"+getName()); //$NON-NLS-1$
_commands = new ArrayList(); _commands = new ArrayList();
_classesToSend = new ArrayList(); _classesToSend = new ArrayList();
_commandGenerator = new CommandGenerator(); _commandGenerator = new CommandGenerator();

View file

@ -38,146 +38,146 @@ public class DE
/* /*
* The nested data (children) property identifier of a <code>DataElement</code>. * The nested data (children) property identifier of a <code>DataElement</code>.
*/ */
public static final String P_CHILDREN = "children"; public static final String P_CHILDREN = "children"; //$NON-NLS-1$
/* /*
* The image property identifier of a <code>DataElement</code>. This is the same * The image property identifier of a <code>DataElement</code>. This is the same
* as the value property identifier * as the value property identifier
*/ */
public static final String P_LABEL = "label"; public static final String P_LABEL = "label"; //$NON-NLS-1$
/* /*
* The notifier property identifier of a <code>DataElement</code>. * The notifier property identifier of a <code>DataElement</code>.
*/ */
public static final String P_NOTIFIER = "notifier"; public static final String P_NOTIFIER = "notifier"; //$NON-NLS-1$
/* /*
* The <code>DataStore</code> property identifier of a <code>DataElement</code>. * The <code>DataStore</code> property identifier of a <code>DataElement</code>.
*/ */
public static final String P_DATASTORE = "dataStore"; public static final String P_DATASTORE = "dataStore"; //$NON-NLS-1$
/* /*
* The source name property identifier of a <code>DataElement</code>. This is the * The source name property identifier of a <code>DataElement</code>. This is the
* name of a source location if one exists. * name of a source location if one exists.
*/ */
public static final String P_SOURCE_NAME = "source"; public static final String P_SOURCE_NAME = "source"; //$NON-NLS-1$
/* /*
* The source file property identifier of a <code>DataElement</code>. * The source file property identifier of a <code>DataElement</code>.
*/ */
public static final String P_SOURCE = "sourcefile"; public static final String P_SOURCE = "sourcefile"; //$NON-NLS-1$
/* /*
* The source location property identifier of a <code>DataElement</code>. * The source location property identifier of a <code>DataElement</code>.
*/ */
public static final String P_SOURCE_LOCATION = "sourcelocation"; public static final String P_SOURCE_LOCATION = "sourcelocation"; //$NON-NLS-1$
public static final String P_SOURCE_LOCATION_COLUMN = "sourcelocationcolumn"; public static final String P_SOURCE_LOCATION_COLUMN = "sourcelocationcolumn"; //$NON-NLS-1$
/* /*
* The nested data (children) property identifier of a <code>DataElement</code>. Same as <code>P_CHILDREN</code>. * The nested data (children) property identifier of a <code>DataElement</code>. Same as <code>P_CHILDREN</code>.
*/ */
public static final String P_NESTED = "nested"; public static final String P_NESTED = "nested"; //$NON-NLS-1$
/* /*
* The buffer property identifier of a <code>DataElement</code>. * The buffer property identifier of a <code>DataElement</code>.
*/ */
public static final String P_BUFFER = "buffer"; public static final String P_BUFFER = "buffer"; //$NON-NLS-1$
/* /*
* The type property identifier of a <code>DataElement</code>. * The type property identifier of a <code>DataElement</code>.
*/ */
public static final String P_TYPE = "type"; public static final String P_TYPE = "type"; //$NON-NLS-1$
/* /*
* The id property identifier of a <code>DataElement</code>. * The id property identifier of a <code>DataElement</code>.
*/ */
public static final String P_ID = "id"; public static final String P_ID = "id"; //$NON-NLS-1$
/* /*
* The name property identifier of a <code>DataElement</code>. * The name property identifier of a <code>DataElement</code>.
*/ */
public static final String P_NAME = "name"; public static final String P_NAME = "name"; //$NON-NLS-1$
/* /*
* The value property identifier of a <code>DataElement</code>. * The value property identifier of a <code>DataElement</code>.
*/ */
public static final String P_VALUE = "value"; public static final String P_VALUE = "value"; //$NON-NLS-1$
/* /*
* The <I>is reference?</I> property identifier of a <code>DataElement</code>. Deprecated. Use P_REF_TYPE. * The <I>is reference?</I> property identifier of a <code>DataElement</code>. Deprecated. Use P_REF_TYPE.
*/ */
public static final String P_ISREF = "isRef"; public static final String P_ISREF = "isRef"; //$NON-NLS-1$
/* /*
* The <I>is reference?</I> property identifier of a <code>DataElement</code>. * The <I>is reference?</I> property identifier of a <code>DataElement</code>.
*/ */
public static final String P_REF_TYPE = "refType"; public static final String P_REF_TYPE = "refType"; //$NON-NLS-1$
/* /*
* The visibility property identifier of a <code>DataElement</code>. * The visibility property identifier of a <code>DataElement</code>.
*/ */
public static final String P_DEPTH = "depth"; public static final String P_DEPTH = "depth"; //$NON-NLS-1$
/* /*
* The attributes property identifier of a <code>DataElement</code>. * The attributes property identifier of a <code>DataElement</code>.
*/ */
public static final String P_ATTRIBUTES = "attribute"; public static final String P_ATTRIBUTES = "attribute"; //$NON-NLS-1$
/* /*
* The file property identifier of a <code>DataElement</code>. * The file property identifier of a <code>DataElement</code>.
*/ */
public static final String P_FILE = "file"; public static final String P_FILE = "file"; //$NON-NLS-1$
/* /*
* The file property identifier of a <code>DataElement</code>. * The file property identifier of a <code>DataElement</code>.
*/ */
public static final String P_DESCRIPTOR = "descriptor"; public static final String P_DESCRIPTOR = "descriptor"; //$NON-NLS-1$
/* /*
* Reference type. * Reference type.
*/ */
public static final String T_REFERENCE = "reference"; public static final String T_REFERENCE = "reference"; //$NON-NLS-1$
/* /*
* Command type. * Command type.
*/ */
public static final String T_COMMAND = "command"; public static final String T_COMMAND = "command"; //$NON-NLS-1$
/* /*
* UI Command Descriptor type. * UI Command Descriptor type.
*/ */
public static final String T_UI_COMMAND_DESCRIPTOR = "ui_commanddescriptor"; public static final String T_UI_COMMAND_DESCRIPTOR = "ui_commanddescriptor"; //$NON-NLS-1$
/* /*
* Object Descriptor type. * Object Descriptor type.
*/ */
public static final String T_OBJECT_DESCRIPTOR = "objectdescriptor"; public static final String T_OBJECT_DESCRIPTOR = "objectdescriptor"; //$NON-NLS-1$
/* /*
* Command Descriptor type. * Command Descriptor type.
*/ */
public static final String T_COMMAND_DESCRIPTOR = "commanddescriptor"; public static final String T_COMMAND_DESCRIPTOR = "commanddescriptor"; //$NON-NLS-1$
/* /*
* Relation Descriptor type. * Relation Descriptor type.
*/ */
public static final String T_RELATION_DESCRIPTOR = "relationdescriptor"; public static final String T_RELATION_DESCRIPTOR = "relationdescriptor"; //$NON-NLS-1$
/* /*
* Abstract Object Descriptor type. * Abstract Object Descriptor type.
*/ */
public static final String T_ABSTRACT_OBJECT_DESCRIPTOR = "abstractobjectdescriptor"; public static final String T_ABSTRACT_OBJECT_DESCRIPTOR = "abstractobjectdescriptor"; //$NON-NLS-1$
/* /*
* Abstract Command Descriptor type. * Abstract Command Descriptor type.
*/ */
public static final String T_ABSTRACT_COMMAND_DESCRIPTOR = "abstractcommanddescriptor"; public static final String T_ABSTRACT_COMMAND_DESCRIPTOR = "abstractcommanddescriptor"; //$NON-NLS-1$
/* /*
* Abstract Relation Descriptor type. * Abstract Relation Descriptor type.
*/ */
public static final String T_ABSTRACT_RELATION_DESCRIPTOR = "abstractrelationdescriptor"; public static final String T_ABSTRACT_RELATION_DESCRIPTOR = "abstractrelationdescriptor"; //$NON-NLS-1$
/* /*
@ -231,5 +231,5 @@ public class DE
*/ */
public static final int A_SIZE = 8; public static final int A_SIZE = 8;
public static final String ENCODING_UTF_8 = "UTF-8"; public static final String ENCODING_UTF_8 = "UTF-8"; //$NON-NLS-1$
} }

View file

@ -302,7 +302,7 @@ public final class DataElement implements IDataElement
String depthStr = getAttribute(DE.A_DEPTH); String depthStr = getAttribute(DE.A_DEPTH);
if (depthStr != null && depthStr.length() > 0) if (depthStr != null && depthStr.length() > 0)
{ {
if (!depthStr.equals("2")) if (!depthStr.equals("2")) //$NON-NLS-1$
{ {
try try
{ {
@ -902,7 +902,7 @@ public final class DataElement implements IDataElement
public void setDepth(int depth) public void setDepth(int depth)
{ {
_depth = depth; _depth = depth;
setAttribute(DE.A_DEPTH, "" + _depth); setAttribute(DE.A_DEPTH, "" + _depth); //$NON-NLS-1$
_isUpdated = false; _isUpdated = false;
//_dataStore.refresh(this); //_dataStore.refresh(this);
} }
@ -975,7 +975,7 @@ public final class DataElement implements IDataElement
String typeName = type.getName(); String typeName = type.getName();
if (typeType.equals(DE.T_OBJECT_DESCRIPTOR) || typeType.equals(DE.T_ABSTRACT_OBJECT_DESCRIPTOR)) if (typeType.equals(DE.T_OBJECT_DESCRIPTOR) || typeType.equals(DE.T_ABSTRACT_OBJECT_DESCRIPTOR))
{ {
if (descriptor.getName().equals(typeName) || (typeName.equals("all"))) if (descriptor.getName().equals(typeName) || (typeName.equals("all"))) //$NON-NLS-1$
{ {
result = true; result = true;
return result; return result;
@ -989,14 +989,15 @@ public final class DataElement implements IDataElement
{ {
abstracted = descriptor.getAssociated(relationship); abstracted = descriptor.getAssociated(relationship);
} }
if (abstracted != null)
{
for (int i = 0;(i < abstracted.size()) && !result; i++) for (int i = 0;(i < abstracted.size()) && !result; i++)
{ {
DataElement superDescriptor = (DataElement) abstracted.get(i); DataElement superDescriptor = (DataElement) abstracted.get(i);
result = superDescriptor.isOfType(type, true); result = superDescriptor.isOfType(type, true);
} }
} }
}
return result; return result;
} }
@ -1120,7 +1121,7 @@ public final class DataElement implements IDataElement
} }
} }
} }
else if (type.equals("contents")) else if (type.equals("contents")) //$NON-NLS-1$
{ {
if (nestedObject == object) if (nestedObject == object)
{ {
@ -1415,23 +1416,23 @@ public final class DataElement implements IDataElement
*/ */
public String toString() public String toString()
{ {
return "DataElement " return "DataElement " //$NON-NLS-1$
+ (_isReference ? "reference" : "") + (_isReference ? "reference" : "") //$NON-NLS-1$ //$NON-NLS-2$
+ "\n{\n\tType:\t" + "\n{\n\tType:\t" //$NON-NLS-1$
+ getType() + getType()
+ "\n\tName:\t" + "\n\tName:\t" //$NON-NLS-1$
+ getName() + getName()
+ "\n\tValue:\t" + "\n\tValue:\t" //$NON-NLS-1$
+ getValue() + getValue()
+ "\n\tID:\t" + "\n\tID:\t" //$NON-NLS-1$
+ getId() + getId()
+ "\n\tSource:\t" + "\n\tSource:\t" //$NON-NLS-1$
+ getSource() + getSource()
+ "\n\tDepth:\t" + "\n\tDepth:\t" //$NON-NLS-1$
+ _depth + _depth
+ "\n\tDataStore:\t" + "\n\tDataStore:\t" //$NON-NLS-1$
+ _dataStore.getName() + _dataStore.getName()
+ "\n}\n"; + "\n}\n"; //$NON-NLS-1$
} }
/** /**
@ -1501,7 +1502,7 @@ public final class DataElement implements IDataElement
else if (DE.P_SOURCE_NAME.equals(name)) else if (DE.P_SOURCE_NAME.equals(name))
{ {
String source = getAttribute(DE.A_SOURCE); String source = getAttribute(DE.A_SOURCE);
int locationIndex = source.lastIndexOf(":"); int locationIndex = source.lastIndexOf(":"); //$NON-NLS-1$
if (locationIndex > 3) if (locationIndex > 3)
{ {
return source.substring(0, locationIndex); return source.substring(0, locationIndex);
@ -1556,7 +1557,7 @@ public final class DataElement implements IDataElement
String depthStr = getAttribute(DE.A_DEPTH); String depthStr = getAttribute(DE.A_DEPTH);
if (depthStr != null && depthStr.length() > 0) if (depthStr != null && depthStr.length() > 0)
{ {
if (!depthStr.equals("2")) if (!depthStr.equals("2")) //$NON-NLS-1$
{ {
try try
{ {

View file

@ -134,8 +134,8 @@ public final class DataStore
private HashMap _classReqRepository; private HashMap _classReqRepository;
private File _cacheJar; private File _cacheJar;
public static final String REMOTE_CLASS_CACHE_JARFILE_NAME = "rmt_classloader_cache"; public static final String REMOTE_CLASS_CACHE_JARFILE_NAME = "rmt_classloader_cache"; //$NON-NLS-1$
public static final String JARFILE_EXTENSION = ".jar"; public static final String JARFILE_EXTENSION = ".jar"; //$NON-NLS-1$
private DataElementRemover _deRemover; private DataElementRemover _deRemover;
public static final int SPIRIT_ON_INITIAL_SIZE = 1000; public static final int SPIRIT_ON_INITIAL_SIZE = 1000;
private String referenceTag = null; private String referenceTag = null;
@ -232,8 +232,8 @@ public final class DataStore
if (isVirtual()) _spiritModeOn = true; if (isVirtual()) _spiritModeOn = true;
else else
{ {
String doSpirit = System.getProperty("DSTORE_SPIRIT_ON"); String doSpirit = System.getProperty("DSTORE_SPIRIT_ON"); //$NON-NLS-1$
_spiritModeOn = (doSpirit != null && doSpirit.equals("true")); _spiritModeOn = (doSpirit != null && doSpirit.equals("true")); //$NON-NLS-1$
} }
} }
@ -357,7 +357,7 @@ public final class DataStore
if (isVirtual()) if (isVirtual())
{ {
DataElement location = createObject(_tempRoot, "location", minersLocation); DataElement location = createObject(_tempRoot, "location", minersLocation); //$NON-NLS-1$
DataElement cmd = findCommandDescriptor(DataStoreSchema.C_ADD_MINERS);//localDescriptorQuery(_root.getDescriptor(), DataStoreSchema.C_ADD_MINERS, 1); DataElement cmd = findCommandDescriptor(DataStoreSchema.C_ADD_MINERS);//localDescriptorQuery(_root.getDescriptor(), DataStoreSchema.C_ADD_MINERS, 1);
ArrayList args = new ArrayList(); ArrayList args = new ArrayList();
args.add(location); args.add(location);
@ -807,12 +807,12 @@ public final class DataStore
DataStoreResources.model_root, DataStoreResources.model_root,
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_ROOT_NAME), _dataStoreAttributes.getAttribute(DataStoreAttributes.A_ROOT_NAME),
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_ROOT_PATH), _dataStoreAttributes.getAttribute(DataStoreAttributes.A_ROOT_PATH),
"rootID"); "rootID"); //$NON-NLS-1$
_descriptorRoot = createObject(_root, DE.T_OBJECT_DESCRIPTOR, DataStoreResources.model_descriptors, "", "schemaID"); _descriptorRoot = createObject(_root, DE.T_OBJECT_DESCRIPTOR, DataStoreResources.model_descriptors, "", "schemaID"); //$NON-NLS-1$ //$NON-NLS-2$
_ticket = createObject(_root, DataStoreResources.model_ticket, "null", "", "ticketID"); _ticket = createObject(_root, DataStoreResources.model_ticket, "null", "", "ticketID"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
createRoots(); createRoots();
initializeDescriptors(); initializeDescriptors();
@ -1114,7 +1114,7 @@ public final class DataStore
*/ */
public DataElement createObject(DataElement parent, DataElement type, String name) public DataElement createObject(DataElement parent, DataElement type, String name)
{ {
return createObject(parent, type, name, ""); return createObject(parent, type, name, ""); //$NON-NLS-1$
} }
/** /**
@ -1127,7 +1127,7 @@ public final class DataStore
*/ */
public DataElement createObject(DataElement parent, String type, String name) public DataElement createObject(DataElement parent, String type, String name)
{ {
return createObject(parent, type, name, ""); return createObject(parent, type, name, ""); //$NON-NLS-1$
} }
/** /**
@ -1333,7 +1333,7 @@ public final class DataStore
*/ */
public DataElement createAbstractObjectDescriptor(DataElement parent, String name) public DataElement createAbstractObjectDescriptor(DataElement parent, String name)
{ {
DataElement descriptor = createObject(parent, DE.T_ABSTRACT_OBJECT_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); DataElement descriptor = createObject(parent, DE.T_ABSTRACT_OBJECT_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
_objDescriptorMap.put(name, descriptor); _objDescriptorMap.put(name, descriptor);
return descriptor; return descriptor;
} }
@ -1366,11 +1366,11 @@ public final class DataStore
DataElement descriptor = null; DataElement descriptor = null;
if (parentDescriptor != null) if (parentDescriptor != null)
{ {
descriptor = createObject(parent, parentDescriptor, name, "org.eclipse.rse.dstore.core", name); descriptor = createObject(parent, parentDescriptor, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
} }
else else
{ {
descriptor = createObject(parent, DE.T_OBJECT_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); descriptor = createObject(parent, DE.T_OBJECT_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
} }
_objDescriptorMap.put(name, descriptor); _objDescriptorMap.put(name, descriptor);
return descriptor; return descriptor;
@ -1409,7 +1409,7 @@ public final class DataStore
*/ */
public DataElement createAbstractRelationDescriptor(DataElement parent, String name) public DataElement createAbstractRelationDescriptor(DataElement parent, String name)
{ {
DataElement descriptor = createObject(parent, DE.T_ABSTRACT_RELATION_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); DataElement descriptor = createObject(parent, DE.T_ABSTRACT_RELATION_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
_relDescriptorMap.put(name, descriptor); _relDescriptorMap.put(name, descriptor);
return descriptor; return descriptor;
} }
@ -1438,7 +1438,7 @@ public final class DataStore
*/ */
public DataElement createRelationDescriptor(DataElement parent, String name) public DataElement createRelationDescriptor(DataElement parent, String name)
{ {
DataElement descriptor = createObject(parent, DE.T_RELATION_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); DataElement descriptor = createObject(parent, DE.T_RELATION_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
_relDescriptorMap.put(name, descriptor); _relDescriptorMap.put(name, descriptor);
return descriptor; return descriptor;
} }
@ -1482,7 +1482,7 @@ public final class DataStore
*/ */
public DataElement createAbstractCommandDescriptor(DataElement parent, String name, String value) public DataElement createAbstractCommandDescriptor(DataElement parent, String name, String value)
{ {
DataElement cmd = createObject(parent, DE.T_ABSTRACT_COMMAND_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); DataElement cmd = createObject(parent, DE.T_ABSTRACT_COMMAND_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
cmd.setAttribute(DE.A_VALUE, value); cmd.setAttribute(DE.A_VALUE, value);
_cmdDescriptorMap.put(value, cmd); _cmdDescriptorMap.put(value, cmd);
return cmd; return cmd;
@ -1533,11 +1533,11 @@ public final class DataStore
DataElement cmd = null; DataElement cmd = null;
if (parentDescriptor != null) if (parentDescriptor != null)
{ {
cmd = createObject(parent, parentDescriptor, name, "org.eclipse.rse.dstore.core", name); cmd = createObject(parent, parentDescriptor, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
} }
else else
{ {
cmd = createObject(parent, DE.T_COMMAND_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); cmd = createObject(parent, DE.T_COMMAND_DESCRIPTOR, name, "org.eclipse.rse.dstore.core", name); //$NON-NLS-1$
} }
cmd.setAttribute(DE.A_VALUE, value); cmd.setAttribute(DE.A_VALUE, value);
_cmdDescriptorMap.put(value, cmd); _cmdDescriptorMap.put(value, cmd);
@ -2049,7 +2049,7 @@ public final class DataStore
DataElement cmd = findCommandDescriptor(DataStoreSchema.C_SET_PREFERENCE); DataElement cmd = findCommandDescriptor(DataStoreSchema.C_SET_PREFERENCE);
if (cmd != null) if (cmd != null)
{ {
DataElement prefObj = createObject(null, "preference", property); DataElement prefObj = createObject(null, "preference", property); //$NON-NLS-1$
prefObj.setAttribute(DE.A_VALUE, value); prefObj.setAttribute(DE.A_VALUE, value);
command(cmd, prefObj, true); command(cmd, prefObj, true);
} }
@ -2169,7 +2169,7 @@ public final class DataStore
{ {
if (ticketStr == null) if (ticketStr == null)
{ {
ticketStr = "null"; ticketStr = "null"; //$NON-NLS-1$
} }
return createObject(_tempRoot, DataStoreResources.model_ticket, ticketStr); return createObject(_tempRoot, DataStoreResources.model_ticket, ticketStr);
} }
@ -2179,7 +2179,7 @@ public final class DataStore
DataElement cmd = findCommandDescriptor(DataStoreSchema.C_VALIDATE_TICKET); DataElement cmd = findCommandDescriptor(DataStoreSchema.C_VALIDATE_TICKET);
DataElement status = _commandHandler.command(cmd, ticket, false); DataElement status = _commandHandler.command(cmd, ticket, false);
if (ticket.getName().equals("null")) if (ticket.getName().equals("null")) //$NON-NLS-1$
{ {
return null; return null;
} }
@ -2240,7 +2240,7 @@ public final class DataStore
startWaiting(status); startWaiting(status);
while ((status != null) while ((status != null)
&& (_status == null || _status.getName().equals("okay")) && (_status == null || _status.getName().equals("okay")) //$NON-NLS-1$
&& !status.getName().equals(state) && !status.getName().equals(state)
&& !status.getValue().equals(state) && !status.getValue().equals(state)
&& !status.getName().equals(DataStoreResources.model_incomplete) && !status.getName().equals(DataStoreResources.model_incomplete)
@ -2268,6 +2268,7 @@ public final class DataStore
if (timedOut) if (timedOut)
{ {
if (status != null)
status.setAttribute(DE.A_NAME, DataStoreResources.model_timeout); status.setAttribute(DE.A_NAME, DataStoreResources.model_timeout);
} }
@ -3402,12 +3403,12 @@ public final class DataStore
{ {
if (_userPreferencesDirectory == null) { if (_userPreferencesDirectory == null) {
_userPreferencesDirectory = System.getProperty("user.home"); _userPreferencesDirectory = System.getProperty("user.home"); //$NON-NLS-1$
String clientUserID = System.getProperty("client.username"); String clientUserID = System.getProperty("client.username"); //$NON-NLS-1$
if (clientUserID == null || clientUserID.equals("")) if (clientUserID == null || clientUserID.equals("")) //$NON-NLS-1$
{ {
clientUserID = ""; clientUserID = ""; //$NON-NLS-1$
} }
else else
{ {
@ -3421,8 +3422,8 @@ public final class DataStore
_userPreferencesDirectory = _userPreferencesDirectory + File.separator; _userPreferencesDirectory = _userPreferencesDirectory + File.separator;
} }
_userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator + _userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator + //$NON-NLS-1$
"RSE" + File.separator + clientUserID; "RSE" + File.separator + clientUserID; //$NON-NLS-1$
File dirFile = new File(_userPreferencesDirectory); File dirFile = new File(_userPreferencesDirectory);
if (!dirFile.exists()) { if (!dirFile.exists()) {
dirFile.mkdirs(); dirFile.mkdirs();
@ -3453,8 +3454,8 @@ public final class DataStore
_dataStoreSchema = new DataStoreSchema(this); _dataStoreSchema = new DataStoreSchema(this);
String tracingProperty = System.getProperty("DSTORE_TRACING_ON"); String tracingProperty = System.getProperty("DSTORE_TRACING_ON"); //$NON-NLS-1$
if (tracingProperty != null && tracingProperty.equals("true")) if (tracingProperty != null && tracingProperty.equals("true")) //$NON-NLS-1$
{ {
_tracingOn = true; _tracingOn = true;
} }
@ -3465,11 +3466,11 @@ public final class DataStore
if (_tracingOn) if (_tracingOn)
{ {
String logDir = getUserPreferencesDirectory(); String logDir = getUserPreferencesDirectory();
_traceFileHandle = new File(logDir, ".dstoreTrace"); _traceFileHandle = new File(logDir, ".dstoreTrace"); //$NON-NLS-1$
try try
{ {
_traceFile = new RandomAccessFile(_traceFileHandle, "rw"); _traceFile = new RandomAccessFile(_traceFileHandle, "rw"); //$NON-NLS-1$
startTracing(); startTracing();
} }
catch (IOException e) catch (IOException e)
@ -3496,17 +3497,17 @@ public final class DataStore
{ {
if (!isVirtual() && _deRemover == null) if (!isVirtual() && _deRemover == null)
{ {
String memLogging = System.getProperty("DSTORE_MEMLOGGING_ON"); String memLogging = System.getProperty("DSTORE_MEMLOGGING_ON"); //$NON-NLS-1$
_memLoggingOn = (memLogging != null && memLogging.equals("true")); _memLoggingOn = (memLogging != null && memLogging.equals("true")); //$NON-NLS-1$
if (_memLoggingOn) if (_memLoggingOn)
{ {
String logDir = getUserPreferencesDirectory(); String logDir = getUserPreferencesDirectory();
_memLoggingFileHandle = new File(logDir, ".dstoreMemLogging"); _memLoggingFileHandle = new File(logDir, ".dstoreMemLogging"); //$NON-NLS-1$
try try
{ {
_memLogFile = new RandomAccessFile(_memLoggingFileHandle, "rw"); _memLogFile = new RandomAccessFile(_memLoggingFileHandle, "rw"); //$NON-NLS-1$
startMemLogging(); startMemLogging();
} }
catch (IOException e) catch (IOException e)
@ -3722,13 +3723,13 @@ public final class DataStore
private void createRoots() private void createRoots()
{ {
_externalRoot = createObject(_root, DataStoreResources.model_host, "External DataStores", "", "extID"); _externalRoot = createObject(_root, DataStoreResources.model_host, "External DataStores", "", "extID"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
_tempRoot = createObject(_root, "temp", "Temp Root", "", "tempID"); _tempRoot = createObject(_root, "temp", "Temp Root", "", "tempID"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
_dummy = createObject(_root, "temp", "dummy"); _dummy = createObject(_root, "temp", "dummy"); //$NON-NLS-1$ //$NON-NLS-2$
_logRoot = createObject(_root, DataStoreResources.model_log, DataStoreResources.model_Log_Root, "", "logID"); _logRoot = createObject(_root, DataStoreResources.model_log, DataStoreResources.model_Log_Root, "", "logID"); //$NON-NLS-1$ //$NON-NLS-2$
_minerRoot = createObject(_root, DataStoreResources.model_miners, DataStoreResources.model_Tool_Root, "", "minersID"); _minerRoot = createObject(_root, DataStoreResources.model_miners, DataStoreResources.model_Tool_Root, "", "minersID"); //$NON-NLS-1$ //$NON-NLS-2$
_hostRoot = _hostRoot =
createObject( createObject(
@ -3736,9 +3737,9 @@ public final class DataStore
DataStoreResources.model_host, DataStoreResources.model_host,
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_HOST_NAME), _dataStoreAttributes.getAttribute(DataStoreAttributes.A_HOST_NAME),
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_HOST_PATH), _dataStoreAttributes.getAttribute(DataStoreAttributes.A_HOST_PATH),
"hostID"); "hostID"); //$NON-NLS-1$
_status = createObject(_root, DataStoreResources.model_status, "okay", "", "statusID"); _status = createObject(_root, DataStoreResources.model_status, "okay", "", "statusID"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} }
private void deleteObjectHelper(DataElement from, DataElement toDelete, int depth) private void deleteObjectHelper(DataElement from, DataElement toDelete, int depth)
@ -3841,8 +3842,8 @@ public final class DataStore
{ {
} }
trace("-----------------------------------------"); trace("-----------------------------------------"); //$NON-NLS-1$
trace("Start Tracing at " + System.currentTimeMillis()); trace("Start Tracing at " + System.currentTimeMillis()); //$NON-NLS-1$
} }
} }
@ -3858,8 +3859,8 @@ public final class DataStore
{ {
} }
memLog("-----------------------------------------"); memLog("-----------------------------------------"); //$NON-NLS-1$
memLog("Start Memory Logging at " + System.currentTimeMillis()); memLog("Start Memory Logging at " + System.currentTimeMillis()); //$NON-NLS-1$
} }
} }
@ -3889,9 +3890,9 @@ public final class DataStore
for (int i = 0;i<stack.length;i++) for (int i = 0;i<stack.length;i++)
{ {
_traceFile.writeBytes(stack[i].toString()); _traceFile.writeBytes(stack[i].toString());
_traceFile.writeBytes(System.getProperty("line.separator")); _traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
} }
_traceFile.writeBytes(System.getProperty("line.separator")); _traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
} }
catch (IOException ex) catch (IOException ex)
{ {
@ -3906,7 +3907,7 @@ public final class DataStore
try try
{ {
_traceFile.writeBytes(message); _traceFile.writeBytes(message);
_traceFile.writeBytes(System.getProperty("line.separator")); _traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
} }
catch (IOException e) catch (IOException e)
{ {
@ -3920,9 +3921,9 @@ public final class DataStore
{ {
try try
{ {
_memLogFile.writeBytes((new Date()).toString() + ": "); _memLogFile.writeBytes((new Date()).toString() + ": "); //$NON-NLS-1$
_memLogFile.writeBytes(message); _memLogFile.writeBytes(message);
_memLogFile.writeBytes(System.getProperty("line.separator")); _memLogFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
} }
catch (IOException e) catch (IOException e)
{ {
@ -3940,8 +3941,8 @@ public final class DataStore
{ {
try try
{ {
_traceFile.writeBytes("Finished Tracing"); _traceFile.writeBytes("Finished Tracing"); //$NON-NLS-1$
_traceFile.writeBytes(System.getProperty("line.separator")); _traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
_traceFile.close(); _traceFile.close();
} }
catch (IOException e) catch (IOException e)
@ -4032,8 +4033,8 @@ public final class DataStore
catch (IOException e) catch (IOException e)
{ {
// the jar must be corrupted, so we must erase it. // the jar must be corrupted, so we must erase it.
System.out.println("Cache jarfile corrupted... erasing it."); System.out.println("Cache jarfile corrupted... erasing it."); //$NON-NLS-1$
if (!_cacheJar.delete()) System.out.println("Couldn't erase corrupted jarfile!"); if (!_cacheJar.delete()) System.out.println("Couldn't erase corrupted jarfile!"); //$NON-NLS-1$
// try to make a new one again. // try to make a new one again.
assignCacheJar(); assignCacheJar();
return; return;
@ -4041,7 +4042,7 @@ public final class DataStore
oldEntries = oldJarFile.entries(); oldEntries = oldJarFile.entries();
// create a new cache file to store the new class in // create a new cache file to store the new class in
File newJarFile = new File(getCacheDirectory() + REMOTE_CLASS_CACHE_JARFILE_NAME + "_next" + JARFILE_EXTENSION); File newJarFile = new File(getCacheDirectory() + REMOTE_CLASS_CACHE_JARFILE_NAME + "_next" + JARFILE_EXTENSION); //$NON-NLS-1$
JarOutputStream newJarOutput = null; JarOutputStream newJarOutput = null;
try try
@ -4050,7 +4051,7 @@ public final class DataStore
} }
catch (IOException e) catch (IOException e)
{ {
System.out.println("Class caching failed. Could not create new cache jarfile."); System.out.println("Class caching failed. Could not create new cache jarfile."); //$NON-NLS-1$
return; return;
} }
@ -4086,14 +4087,14 @@ public final class DataStore
} }
catch (IOException e) catch (IOException e)
{ {
System.out.println("Class caching failed. Could not recopy entry from old jar. Cleaning..."); System.out.println("Class caching failed. Could not recopy entry from old jar. Cleaning..."); //$NON-NLS-1$
try { newJarOutput.close(); } catch (IOException ee) { } try { newJarOutput.close(); } catch (IOException ee) { }
if (!newJarFile.delete()) System.out.println("Couldn't erase new jarfile!"); if (!newJarFile.delete()) System.out.println("Couldn't erase new jarfile!"); //$NON-NLS-1$
} }
} }
// add the new class file // add the new class file
JarEntry newEntry = new JarEntry(className.replace('.', '/') + ".class"); JarEntry newEntry = new JarEntry(className.replace('.', '/') + ".class"); //$NON-NLS-1$
newEntry.setCompressedSize(-1); newEntry.setCompressedSize(-1);
try try
@ -4105,17 +4106,17 @@ public final class DataStore
} }
catch (IOException e) catch (IOException e)
{ {
System.out.println("Class caching failed. Could not cache new class into new jar. Cleaning..."); System.out.println("Class caching failed. Could not cache new class into new jar. Cleaning..."); //$NON-NLS-1$
try { newJarOutput.close(); } catch (IOException ee) { } try { newJarOutput.close(); } catch (IOException ee) { }
if (!newJarFile.delete()) System.out.println("Couldn't erase new jarfile!"); if (!newJarFile.delete()) System.out.println("Couldn't erase new jarfile!"); //$NON-NLS-1$
} }
// get rid of the old jar file // get rid of the old jar file
try { oldJarFile.close(); } catch (IOException ee) { } try { oldJarFile.close(); } catch (IOException ee) { }
if (!_cacheJar.delete()) System.out.println("Could not delete old cache jar."); if (!_cacheJar.delete()) System.out.println("Could not delete old cache jar."); //$NON-NLS-1$
if (!newJarFile.renameTo(_cacheJar)) System.out.println("Could not rename new cache jar."); if (!newJarFile.renameTo(_cacheJar)) System.out.println("Could not rename new cache jar."); //$NON-NLS-1$
System.out.println(className + " cached in " + _cacheJar.getAbsolutePath()); System.out.println(className + " cached in " + _cacheJar.getAbsolutePath()); //$NON-NLS-1$
} }
protected JarOutputStream createNewCacheJar(File newJar) throws IOException protected JarOutputStream createNewCacheJar(File newJar) throws IOException
@ -4131,14 +4132,14 @@ public final class DataStore
{ {
String cacheDirectory = getCacheDirectory(); String cacheDirectory = getCacheDirectory();
File cacheJar = new File(cacheDirectory + REMOTE_CLASS_CACHE_JARFILE_NAME + JARFILE_EXTENSION); File cacheJar = new File(cacheDirectory + REMOTE_CLASS_CACHE_JARFILE_NAME + JARFILE_EXTENSION);
File nextCacheJar = new File(cacheDirectory + REMOTE_CLASS_CACHE_JARFILE_NAME + "_next" + JARFILE_EXTENSION); File nextCacheJar = new File(cacheDirectory + REMOTE_CLASS_CACHE_JARFILE_NAME + "_next" + JARFILE_EXTENSION); //$NON-NLS-1$
if (nextCacheJar.exists()) nextCacheJar.renameTo(cacheJar); if (nextCacheJar.exists()) nextCacheJar.renameTo(cacheJar);
if (!cacheJar.exists()) if (!cacheJar.exists())
{ {
try try
{ {
JarOutputStream cacheOut = createNewCacheJar(cacheJar); JarOutputStream cacheOut = createNewCacheJar(cacheJar);
cacheOut.putNextEntry(new JarEntry("/")); cacheOut.putNextEntry(new JarEntry("/")); //$NON-NLS-1$
cacheOut.closeEntry(); cacheOut.closeEntry();
cacheOut.close(); cacheOut.close();
} }

View file

@ -25,7 +25,7 @@ package org.eclipse.dstore.core.model;
public class DataStoreAttributes public class DataStoreAttributes
{ {
public static final String DATASTORE_VERSION = "DataStore.8.0.0"; public static final String DATASTORE_VERSION = "DataStore.8.0.0"; //$NON-NLS-1$
public static final int A_PLUGIN_PATH = 0; public static final int A_PLUGIN_PATH = 0;
public static final int A_ROOT_NAME = 1; public static final int A_ROOT_NAME = 1;
@ -49,21 +49,21 @@ public class DataStoreAttributes
_attributes = new String[A_SIZE]; _attributes = new String[A_SIZE];
// root // root
_attributes[A_ROOT_NAME] = new String("Local"); _attributes[A_ROOT_NAME] = new String("Local"); //$NON-NLS-1$
_attributes[A_ROOT_PATH] = new String(""); _attributes[A_ROOT_PATH] = new String(""); //$NON-NLS-1$
// log // log
_attributes[A_LOG_NAME] = new String("log"); _attributes[A_LOG_NAME] = new String("log"); //$NON-NLS-1$
_attributes[A_LOG_PATH] = new String("log.xml"); _attributes[A_LOG_PATH] = new String("log.xml"); //$NON-NLS-1$
// host // host
_attributes[A_HOST_NAME] = new String(""); _attributes[A_HOST_NAME] = new String(""); //$NON-NLS-1$
_attributes[A_HOST_PATH] = new String(""); _attributes[A_HOST_PATH] = new String(""); //$NON-NLS-1$
_attributes[A_HOST_PORT] = new String("4033"); _attributes[A_HOST_PORT] = new String("4033"); //$NON-NLS-1$
// local // local
_attributes[A_LOCAL_NAME] = new String(""); _attributes[A_LOCAL_NAME] = new String(""); //$NON-NLS-1$
_attributes[A_LOCAL_PATH] = new String(""); _attributes[A_LOCAL_PATH] = new String(""); //$NON-NLS-1$
} }
/** /**

View file

@ -18,98 +18,98 @@ package org.eclipse.dstore.core.model;
public class DataStoreResources public class DataStoreResources
{ {
public static String model_Log_Root="Log Root"; public static String model_Log_Root="Log Root"; //$NON-NLS-1$
public static String model_Tool_Root="Tool Root"; public static String model_Tool_Root="Tool Root"; //$NON-NLS-1$
public static String model_Set="Set"; public static String model_Set="Set"; //$NON-NLS-1$
public static String model_Modify="Modify"; public static String model_Modify="Modify"; //$NON-NLS-1$
public static String model_timeout="timeout"; public static String model_timeout="timeout"; //$NON-NLS-1$
public static String model_data="data"; public static String model_data="data"; //$NON-NLS-1$
public static String model_transient="transient"; public static String model_transient="transient"; //$NON-NLS-1$
public static String model_all="all"; public static String model_all="all"; //$NON-NLS-1$
public static String model_host="host"; public static String model_host="host"; //$NON-NLS-1$
public static String model_root="root"; public static String model_root="root"; //$NON-NLS-1$
public static String model_descriptors="descriptors"; public static String model_descriptors="descriptors"; //$NON-NLS-1$
public static String model_descriptor_for="descriptor for"; public static String model_descriptor_for="descriptor for"; //$NON-NLS-1$
public static String model_project="Project"; public static String model_project="Project"; //$NON-NLS-1$
public static String model_log="log"; public static String model_log="log"; //$NON-NLS-1$
public static String model_deleted="deleted"; public static String model_deleted="deleted"; //$NON-NLS-1$
public static String model_status="status"; public static String model_status="status"; //$NON-NLS-1$
public static String model_start="start"; public static String model_start="start"; //$NON-NLS-1$
public static String model_failed="failed"; public static String model_failed="failed"; //$NON-NLS-1$
public static String model_done="done"; public static String model_done="done"; //$NON-NLS-1$
public static String model_working="working"; public static String model_working="working"; //$NON-NLS-1$
public static String model_progress="progress"; public static String model_progress="progress"; //$NON-NLS-1$
public static String model_error="error"; public static String model_error="error"; //$NON-NLS-1$
public static String model_warning="warning"; public static String model_warning="warning"; //$NON-NLS-1$
public static String model_informational="informational"; public static String model_informational="informational"; //$NON-NLS-1$
public static String model_markers="markers"; public static String model_markers="markers"; //$NON-NLS-1$
public static String model_invocation="invocation"; public static String model_invocation="invocation"; //$NON-NLS-1$
public static String model_pattern="pattern"; public static String model_pattern="pattern"; //$NON-NLS-1$
public static String model_input="input"; public static String model_input="input"; //$NON-NLS-1$
public static String model_output="output"; public static String model_output="output"; //$NON-NLS-1$
public static String model_details="details"; public static String model_details="details"; //$NON-NLS-1$
public static String model_contents="contents"; public static String model_contents="contents"; //$NON-NLS-1$
public static String model_contents_arguments="Contents and Arguments"; public static String model_contents_arguments="Contents and Arguments"; //$NON-NLS-1$
public static String model_parent="parent"; public static String model_parent="parent"; //$NON-NLS-1$
public static String model_arguments="arguments"; public static String model_arguments="arguments"; //$NON-NLS-1$
public static String model_Commands="Commands"; public static String model_Commands="Commands"; //$NON-NLS-1$
public static String model_device="device"; public static String model_device="device"; //$NON-NLS-1$
public static String model_directory="directory"; public static String model_directory="directory"; //$NON-NLS-1$
public static String model_folder="folder"; public static String model_folder="folder"; //$NON-NLS-1$
public static String model_file="file"; public static String model_file="file"; //$NON-NLS-1$
public static String model_Filesystem_Objects="Filesystem Objects"; public static String model_Filesystem_Objects="Filesystem Objects"; //$NON-NLS-1$
public static String model_Container_Object="Container Object"; public static String model_Container_Object="Container Object"; //$NON-NLS-1$
public static String model_Directories="Directories"; public static String model_Directories="Directories"; //$NON-NLS-1$
public static String model_Details="Details"; public static String model_Details="Details"; //$NON-NLS-1$
public static String model_miners="miners"; public static String model_miners="miners"; //$NON-NLS-1$
public static String model_miner="miner"; public static String model_miner="miner"; //$NON-NLS-1$
public static String model_state="state"; public static String model_state="state"; //$NON-NLS-1$
public static String model_ticket="ticket"; public static String model_ticket="ticket"; //$NON-NLS-1$
public static String model_valid="valid"; public static String model_valid="valid"; //$NON-NLS-1$
public static String model_invalid="invalid"; public static String model_invalid="invalid"; //$NON-NLS-1$
public static String model_abstracted_by="abstracted by"; public static String model_abstracted_by="abstracted by"; //$NON-NLS-1$
public static String model_abstracts="abstracts"; public static String model_abstracts="abstracts"; //$NON-NLS-1$
public static String model_incomplete="incomplete"; public static String model_incomplete="incomplete"; //$NON-NLS-1$
public static String model_Miner_Details="Miner Details"; public static String model_Miner_Details="Miner Details"; //$NON-NLS-1$
public static String model_Hosts="Hosts"; public static String model_Hosts="Hosts"; //$NON-NLS-1$
public static String model_Tools="Tools"; public static String model_Tools="Tools"; //$NON-NLS-1$
public static String model_Schema="Schema"; public static String model_Schema="Schema"; //$NON-NLS-1$
public static String model_Logged_Commands="Logged Commands"; public static String model_Logged_Commands="Logged Commands"; //$NON-NLS-1$
public static String model_Cancel="Cancel"; public static String model_Cancel="Cancel"; //$NON-NLS-1$
public static String model_Get_Schema="Get Schema"; public static String model_Get_Schema="Get Schema"; //$NON-NLS-1$
public static String model_Show_Ticket="Show Ticket"; public static String model_Show_Ticket="Show Ticket"; //$NON-NLS-1$
public static String model_Init_Miners="Init Miners"; public static String model_Init_Miners="Init Miners"; //$NON-NLS-1$
public static String model_Set_Host="Set Host"; public static String model_Set_Host="Set Host"; //$NON-NLS-1$
public static String model_Exit="Exit"; public static String model_Exit="Exit"; //$NON-NLS-1$
public static String model_Connect_to="Connect to"; public static String model_Connect_to="Connect to"; //$NON-NLS-1$
public static String model_Disconnect_from="Disconnect from"; public static String model_Disconnect_from="Disconnect from"; //$NON-NLS-1$
public static String model_Delete_Connection="Delete Connection"; public static String model_Delete_Connection="Delete Connection"; //$NON-NLS-1$
public static String model_time="time"; public static String model_time="time"; //$NON-NLS-1$
public static String model_property="property"; public static String model_property="property"; //$NON-NLS-1$
public static String model_start_time="start time"; public static String model_start_time="start time"; //$NON-NLS-1$
public static String model_command_time="command time"; public static String model_command_time="command time"; //$NON-NLS-1$
public static String model_Transient_Objects="Transient Objects"; public static String model_Transient_Objects="Transient Objects"; //$NON-NLS-1$
public static String model_Data="Data"; public static String model_Data="Data"; //$NON-NLS-1$
public static String model_No_input="No input"; public static String model_No_input="No input"; //$NON-NLS-1$
public static String model_Open="Open"; public static String model_Open="Open"; //$NON-NLS-1$
public static String model_Close="Close"; public static String model_Close="Close"; //$NON-NLS-1$
public static String model_Refresh="Refresh"; public static String model_Refresh="Refresh"; //$NON-NLS-1$
public static String model_Query="Query"; public static String model_Query="Query"; //$NON-NLS-1$
public static String model_Cancellable="Cancellable"; public static String model_Cancellable="Cancellable"; //$NON-NLS-1$
public static String SERIALIZED_TYPE="SERIALIZED"; public static String SERIALIZED_TYPE="SERIALIZED"; //$NON-NLS-1$
public static String CLASS_TYPE="CLASS"; public static String CLASS_TYPE="CLASS"; //$NON-NLS-1$
public static String REQUEST_CLASS_TYPE="REQUEST_CLASS"; public static String REQUEST_CLASS_TYPE="REQUEST_CLASS"; //$NON-NLS-1$
public static String DEFAULT_CLASSBYTESTREAMHANDLER="default"; public static String DEFAULT_CLASSBYTESTREAMHANDLER="default"; //$NON-NLS-1$
public static String FILE_TYPE="FILE"; public static String FILE_TYPE="FILE"; //$NON-NLS-1$
public static String DOCUMENT_TYPE="DOCUMENT"; public static String DOCUMENT_TYPE="DOCUMENT"; //$NON-NLS-1$
public static String DEFAULT_BYTESTREAMHANDLER="default"; public static String DEFAULT_BYTESTREAMHANDLER="default"; //$NON-NLS-1$
public static String TRUE="true"; public static String TRUE="true"; //$NON-NLS-1$
public static String FALSE="false"; public static String FALSE="false"; //$NON-NLS-1$
public static String DELETED="deleted"; public static String DELETED="deleted"; //$NON-NLS-1$
public static String KEEPALIVE_TYPE="KEEPALIVE"; public static String KEEPALIVE_TYPE="KEEPALIVE"; //$NON-NLS-1$
public static String KEEPALIVECONFIRM_TYPE="CONFIRMKEEPALIVE"; public static String KEEPALIVECONFIRM_TYPE="CONFIRMKEEPALIVE"; //$NON-NLS-1$
public static String REFERENCE="reference"; public static String REFERENCE="reference"; //$NON-NLS-1$
public static String VALUE="value"; public static String VALUE="value"; //$NON-NLS-1$
public static String SPIRIT="spirit"; public static String SPIRIT="spirit"; //$NON-NLS-1$
} }

View file

@ -42,26 +42,26 @@ public class DataStoreSchema
private DataElement _abstractRelationDescriptor; private DataElement _abstractRelationDescriptor;
public static final String C_VALIDATE_TICKET = "C_VALIDATE_TICKET"; public static final String C_VALIDATE_TICKET = "C_VALIDATE_TICKET"; //$NON-NLS-1$
public static final String C_SET = "C_SET"; public static final String C_SET = "C_SET"; //$NON-NLS-1$
public static final String C_MODIFY = "C_MODIFY"; public static final String C_MODIFY = "C_MODIFY"; //$NON-NLS-1$
public static final String C_SET_HOST = "C_SET_HOST"; public static final String C_SET_HOST = "C_SET_HOST"; //$NON-NLS-1$
public static final String C_SCHEMA = "C_SCHEMA"; public static final String C_SCHEMA = "C_SCHEMA"; //$NON-NLS-1$
public static final String C_SET_PREFERENCE = "C_SET_PREFERENCE"; public static final String C_SET_PREFERENCE = "C_SET_PREFERENCE"; //$NON-NLS-1$
public static final String C_ADD_MINERS = "C_ADD_MINERS"; public static final String C_ADD_MINERS = "C_ADD_MINERS"; //$NON-NLS-1$
public static final String C_ACTIVATE_MINER = "C_ACTIVATE_MINER"; public static final String C_ACTIVATE_MINER = "C_ACTIVATE_MINER"; //$NON-NLS-1$
public static final String C_INIT_MINERS = "C_INIT_MINERS"; public static final String C_INIT_MINERS = "C_INIT_MINERS"; //$NON-NLS-1$
public static final String C_OPEN = "C_OPEN"; public static final String C_OPEN = "C_OPEN"; //$NON-NLS-1$
public static final String C_CANCEL = "C_CANCEL"; public static final String C_CANCEL = "C_CANCEL"; //$NON-NLS-1$
public static final String C_SEND_INPUT = "C_SEND_INPUT"; public static final String C_SEND_INPUT = "C_SEND_INPUT"; //$NON-NLS-1$
public static final String C_QUERY = "C_QUERY"; public static final String C_QUERY = "C_QUERY"; //$NON-NLS-1$
public static final String C_REFRESH = "C_REFRESH"; public static final String C_REFRESH = "C_REFRESH"; //$NON-NLS-1$
public static final String C_EXIT = "C_EXIT"; public static final String C_EXIT = "C_EXIT"; //$NON-NLS-1$
public static final String C_CLOSE = "C_CLOSE"; public static final String C_CLOSE = "C_CLOSE"; //$NON-NLS-1$
public static final String C_NOTIFICATION = "C_NOTIFICATION"; public static final String C_NOTIFICATION = "C_NOTIFICATION"; //$NON-NLS-1$
public static final String C_QUERY_INSTALL = "C_QUERY_INSTALL"; public static final String C_QUERY_INSTALL = "C_QUERY_INSTALL"; //$NON-NLS-1$
public static final String C_QUERY_CLIENT_IP = "C_QUERY_CLIENT_IP"; public static final String C_QUERY_CLIENT_IP = "C_QUERY_CLIENT_IP"; //$NON-NLS-1$
public static final String C_QUERY_JVM = "C_QUERY_JVM"; public static final String C_QUERY_JVM = "C_QUERY_JVM"; //$NON-NLS-1$
/** /**
@ -234,7 +234,7 @@ public class DataStoreSchema
DataElement parentD = _dataStore.createRelationDescriptor(schemaRoot, DataStoreResources.model_parent); DataElement parentD = _dataStore.createRelationDescriptor(schemaRoot, DataStoreResources.model_parent);
parentD.setDepth(1); parentD.setDepth(1);
_attributes = _dataStore.createRelationDescriptor(schemaRoot, "attributes"); _attributes = _dataStore.createRelationDescriptor(schemaRoot, "attributes"); //$NON-NLS-1$
_attributes.setDepth(0); _attributes.setDepth(0);
DataElement argsD = _dataStore.createRelationDescriptor(schemaRoot, DataStoreResources.model_arguments); DataElement argsD = _dataStore.createRelationDescriptor(schemaRoot, DataStoreResources.model_arguments);
@ -271,7 +271,7 @@ public class DataStoreSchema
//Base Container Object //Base Container Object
_container = _dataStore.createAbstractObjectDescriptor(schemaRoot, DataStoreResources.model_Container_Object); _container = _dataStore.createAbstractObjectDescriptor(schemaRoot, DataStoreResources.model_Container_Object);
_dataStore.createCommandDescriptor(_container, DataStoreResources.model_Query, "*", C_QUERY, false); _dataStore.createCommandDescriptor(_container, DataStoreResources.model_Query, "*", C_QUERY, false); //$NON-NLS-1$
_dataStore.createReference(_container, _contents, _contents); _dataStore.createReference(_container, _contents, _contents);
// file objects // file objects
@ -312,23 +312,23 @@ public class DataStoreSchema
// basic commands // basic commands
_dataStore.createCommandDescriptor(cancellable, DataStoreResources.model_Cancel, "*", C_CANCEL); _dataStore.createCommandDescriptor(cancellable, DataStoreResources.model_Cancel, "*", C_CANCEL); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set, "-", C_SET, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set, "-", C_SET, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set_Host, "-", C_SET_HOST, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set_Host, "-", C_SET_HOST, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Init_Miners, "*", C_INIT_MINERS, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Init_Miners, "*", C_INIT_MINERS, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, "Add Miners", "-", C_ADD_MINERS, false); _dataStore.createCommandDescriptor(rootD, "Add Miners", "-", C_ADD_MINERS, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Activate Miner", "-", C_ACTIVATE_MINER, false); _dataStore.createCommandDescriptor(rootD, "Activate Miner", "-", C_ACTIVATE_MINER, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Set Preference", "-", C_SET_PREFERENCE, false); _dataStore.createCommandDescriptor(rootD, "Set Preference", "-", C_SET_PREFERENCE, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Show_Ticket, "-", C_VALIDATE_TICKET, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Show_Ticket, "-", C_VALIDATE_TICKET, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Get_Schema, "*", C_SCHEMA, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Get_Schema, "*", C_SCHEMA, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Exit, "*", C_EXIT, false); _dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Exit, "*", C_EXIT, false); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, "Query Install", "*", C_QUERY_INSTALL, false); _dataStore.createCommandDescriptor(rootD, "Query Install", "*", C_QUERY_INSTALL, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Query Client IP", "*", C_QUERY_CLIENT_IP, false); _dataStore.createCommandDescriptor(rootD, "Query Client IP", "*", C_QUERY_CLIENT_IP, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Query JVM", "*", C_QUERY_JVM, false); _dataStore.createCommandDescriptor(rootD, "Query JVM", "*", C_QUERY_JVM, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Notification", "*", C_NOTIFICATION, false); _dataStore.createCommandDescriptor(rootD, "Notification", "*", C_NOTIFICATION, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Send Input", "*", C_SEND_INPUT, false); _dataStore.createCommandDescriptor(rootD, "Send Input", "*", C_SEND_INPUT, false); //$NON-NLS-1$ //$NON-NLS-2$
// both ends have this base schema, so mark each descriptor as updated // both ends have this base schema, so mark each descriptor as updated

View file

@ -28,7 +28,7 @@ import java.io.UnsupportedEncodingException;
public class DefaultByteConverter implements IByteConverter public class DefaultByteConverter implements IByteConverter
{ {
private String _clientEncoding = DE.ENCODING_UTF_8; private String _clientEncoding = DE.ENCODING_UTF_8;
private String _hostEncoding = System.getProperty("file.encoding"); private String _hostEncoding = System.getProperty("file.encoding"); //$NON-NLS-1$
public void setContext(File file) public void setContext(File file)
{ {
} }

View file

@ -18,15 +18,15 @@ package org.eclipse.dstore.core.model;
public interface IDataStoreConstants public interface IDataStoreConstants
{ {
public static final String PASSWORD_EXPIRED = "password expired"; public static final String PASSWORD_EXPIRED = "password expired"; //$NON-NLS-1$
public static final String NEW_PASSWORD_INVALID = "new password not valid"; public static final String NEW_PASSWORD_INVALID = "new password not valid"; //$NON-NLS-1$
public static final String AUTHENTICATION_FAILED = "Authentification Failed"; public static final String AUTHENTICATION_FAILED = "Authentification Failed"; //$NON-NLS-1$
public static final String CONNECTED = "connected"; public static final String CONNECTED = "connected"; //$NON-NLS-1$
public static final String UNKNOWN_PROBLEM = "unknown problem connecting to server"; public static final String UNKNOWN_PROBLEM = "unknown problem connecting to server"; //$NON-NLS-1$
public static final String SERVER_FAILURE = "server failure: "; public static final String SERVER_FAILURE = "server failure: "; //$NON-NLS-1$
public static final String ATTEMPT_RECONNECT = "attempt reconnect"; public static final String ATTEMPT_RECONNECT = "attempt reconnect"; //$NON-NLS-1$
public static final String PORT_OUT_RANGE = "specified port out of range:"; public static final String PORT_OUT_RANGE = "specified port out of range:"; //$NON-NLS-1$
public static final String DATASTORE_SPIRIT_DESCRIPTOR = "datastore.spirit"; public static final String DATASTORE_SPIRIT_DESCRIPTOR = "datastore.spirit"; //$NON-NLS-1$
public static final String C_START_SPIRIT = "C_START_SPIRIT"; public static final String C_START_SPIRIT = "C_START_SPIRIT"; //$NON-NLS-1$
} }

View file

@ -45,7 +45,7 @@ public abstract class UpdateHandler extends Handler
*/ */
public UpdateHandler() public UpdateHandler()
{ {
setName("DStore UpdateHandler"+getName()); setName("DStore UpdateHandler"+getName()); //$NON-NLS-1$
_dataObjects = new ArrayList(); _dataObjects = new ArrayList();
_classesToSend = new ArrayList(); _classesToSend = new ArrayList();
} }

View file

@ -174,7 +174,7 @@ public class ConnectionEstablisher
if (session == null) if (session == null)
{ {
System.out.println("handshake failed"); System.out.println("handshake failed"); //$NON-NLS-1$
sslSocket.close(); sslSocket.close();
return; return;
} }
@ -208,7 +208,7 @@ public class ConnectionEstablisher
catch (IOException ioe) catch (IOException ioe)
{ {
System.err.println(ServerReturnCodes.RC_CONNECTION_ERROR); System.err.println(ServerReturnCodes.RC_CONNECTION_ERROR);
System.err.println("Server: error initializing socket: " + ioe); System.err.println("Server: error initializing socket: " + ioe); //$NON-NLS-1$
_continue = false; _continue = false;
} }
} }
@ -240,7 +240,7 @@ public class ConnectionEstablisher
} }
// determine if portStr is a port range or just a port // determine if portStr is a port range or just a port
String[] range = portStr.split("-"); String[] range = portStr.split("-"); //$NON-NLS-1$
if (range.length == 2) if (range.length == 2)
{ {
int lPort = 0; int lPort = 0;
@ -259,7 +259,7 @@ public class ConnectionEstablisher
// create server socket from port // create server socket from port
try try
{ {
if (_dataStore.usingSSL()) if (_dataStore.usingSSL() && sslContext != null)
{ {
try try
{ {
@ -291,7 +291,7 @@ public class ConnectionEstablisher
// create server socket from port // create server socket from port
if (_dataStore.usingSSL()) if (_dataStore.usingSSL() && sslContext != null)
{ {
try try
{ {
@ -330,17 +330,17 @@ public class ConnectionEstablisher
ArrayList loaders = new ArrayList(); ArrayList loaders = new ArrayList();
loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); //$NON-NLS-1$
_commandHandler = new ServerCommandHandler(loaders); _commandHandler = new ServerCommandHandler(loaders);
_updateHandler = new ServerUpdateHandler(); _updateHandler = new ServerUpdateHandler();
String pluginPath = System.getProperty("A_PLUGIN_PATH");
ISSLProperties sslProperties = new ServerSSLProperties(); ISSLProperties sslProperties = new ServerSSLProperties();
_dataStore = new DataStore(_serverAttributes, _commandHandler, _updateHandler, null); _dataStore = new DataStore(_serverAttributes, _commandHandler, _updateHandler, null);
_dataStore.setSSLProperties(sslProperties); _dataStore.setSSLProperties(sslProperties);
DataElement ticket = _dataStore.getTicket(); DataElement ticket = _dataStore.getTicket();
System.out.println("ticket="+ticketStr); //$NON-NLS-1$
ticket.setAttribute(DE.A_NAME, ticketStr); ticket.setAttribute(DE.A_NAME, ticketStr);
_updateHandler.setDataStore(_dataStore); _updateHandler.setDataStore(_dataStore);
@ -379,7 +379,7 @@ public class ConnectionEstablisher
System.err.println(_serverSocket.getLocalPort()); System.err.println(_serverSocket.getLocalPort());
try try
{ {
System.err.println("Server running on: " + InetAddress.getLocalHost().getHostName()); System.err.println("Server running on: " + InetAddress.getLocalHost().getHostName()); //$NON-NLS-1$
} }
catch (UnknownHostException e) catch (UnknownHostException e)
{ {

View file

@ -76,7 +76,7 @@ public class MinerLoader implements ISchemaRegistry
String pluginDir = _dataStore.getAttribute(DataStoreAttributes.A_PLUGIN_PATH); String pluginDir = _dataStore.getAttribute(DataStoreAttributes.A_PLUGIN_PATH);
// default location // default location
String defaultMinerFile = pluginDir + File.separator + "minerFile.dat"; String defaultMinerFile = pluginDir + File.separator + "minerFile.dat"; //$NON-NLS-1$
File defaultMF = new File(defaultMinerFile); File defaultMF = new File(defaultMinerFile);
if (defaultMF.exists()) if (defaultMF.exists())
{ {
@ -86,7 +86,7 @@ public class MinerLoader implements ISchemaRegistry
} }
catch (Exception e) catch (Exception e)
{ {
_dataStore.trace("failed to load minerFile.data with UTF-8. Trying with native encoding"); _dataStore.trace("failed to load minerFile.data with UTF-8. Trying with native encoding"); //$NON-NLS-1$
try try
{ {
@ -106,13 +106,13 @@ public class MinerLoader implements ISchemaRegistry
{ {
String minersDir = (String) minerLocations.get(i); String minersDir = (String) minerLocations.get(i);
String minerFile = null; String minerFile = null;
if (minersDir.endsWith(".dat")) if (minersDir.endsWith(".dat")) //$NON-NLS-1$
{ {
minerFile = pluginDir + File.separator + minersDir; minerFile = pluginDir + File.separator + minersDir;
} }
else else
{ {
minerFile = pluginDir + File.separator + minersDir + File.separator + "minerFile.dat"; minerFile = pluginDir + File.separator + minersDir + File.separator + "minerFile.dat"; //$NON-NLS-1$
} }
//_dataStore.trace("load miners for " + minerFile); //_dataStore.trace("load miners for " + minerFile);
if (!_minerFileList.contains(minerFile)) if (!_minerFileList.contains(minerFile))
@ -123,7 +123,7 @@ public class MinerLoader implements ISchemaRegistry
} }
catch (Exception e) catch (Exception e)
{ {
_dataStore.trace("failed to load minerFile.data with UTF-8. Trying with native encoding"); _dataStore.trace("failed to load minerFile.data with UTF-8. Trying with native encoding"); //$NON-NLS-1$
try try
{ {
loadMiners(minerFile, null); loadMiners(minerFile, null);
@ -166,7 +166,7 @@ public class MinerLoader implements ISchemaRegistry
// check name // check name
name = name.trim(); name = name.trim();
if (!name.startsWith("#") && (name.length() > 5)) if (!name.startsWith("#") && (name.length() > 5)) //$NON-NLS-1$
{ {
Miner miner = loadMiner(name); Miner miner = loadMiner(name);
if (miner != null) if (miner != null)
@ -254,7 +254,7 @@ public class MinerLoader implements ISchemaRegistry
unconnectedMiners.remove(miner); unconnectedMiners.remove(miner);
if (connectMiner(miner)) if (connectMiner(miner))
{ {
_dataStore.trace("connected " + miner.getMinerName()); _dataStore.trace("connected " + miner.getMinerName()); //$NON-NLS-1$
} }
else else
{ {
@ -317,7 +317,7 @@ public class MinerLoader implements ISchemaRegistry
{ {
if (_externalRemoteLoader == null) if (_externalRemoteLoader == null)
{ {
_externalRemoteLoader = new ExternalLoader(getRemoteLoader(), "*"); _externalRemoteLoader = new ExternalLoader(getRemoteLoader(), "*"); //$NON-NLS-1$
} }
return _externalRemoteLoader; return _externalRemoteLoader;
} }

View file

@ -40,9 +40,9 @@ public class Server
//Tell the Launcher that we are starting //Tell the Launcher that we are starting
System.err.println(ServerReturnCodes.RC_DSTORE_SERVER_MAGIC); System.err.println(ServerReturnCodes.RC_DSTORE_SERVER_MAGIC);
String jversion = System.getProperty("java.version"); String jversion = System.getProperty("java.version"); //$NON-NLS-1$
StringTokenizer tokenizer = new StringTokenizer(jversion, "."); StringTokenizer tokenizer = new StringTokenizer(jversion, "."); //$NON-NLS-1$
try try
{ {
String[] vers = new String[3]; String[] vers = new String[3];

View file

@ -38,7 +38,7 @@ public class ServerAttributes extends DataStoreAttributes
try try
{ {
String pluginPath = System.getProperty("A_PLUGIN_PATH"); String pluginPath = System.getProperty("A_PLUGIN_PATH"); //$NON-NLS-1$
if (pluginPath != null) pluginPath = pluginPath.trim(); if (pluginPath != null) pluginPath = pluginPath.trim();
if ((pluginPath != null) && (pluginPath.length() > 0)) if ((pluginPath != null) && (pluginPath.length() > 0))
{ {
@ -56,13 +56,13 @@ public class ServerAttributes extends DataStoreAttributes
} }
else else
{ {
setAttribute(A_PLUGIN_PATH, "/home/"); setAttribute(A_PLUGIN_PATH, "/home/"); //$NON-NLS-1$
} }
setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName()); setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName());
setAttribute(A_HOST_NAME, "server_host"); setAttribute(A_HOST_NAME, "server_host"); //$NON-NLS-1$
setAttribute(A_HOST_PATH, "/home/"); setAttribute(A_HOST_PATH, "/home/"); //$NON-NLS-1$
} }
catch (UnknownHostException e) catch (UnknownHostException e)
{ {

View file

@ -213,7 +213,7 @@ public class ServerCommandHandler extends CommandHandler
DataElement host = _dataStore.getHostRoot(); DataElement host = _dataStore.getHostRoot();
_dataStore.getHashMap().remove(host.getId()); _dataStore.getHashMap().remove(host.getId());
host.setAttribute(DE.A_ID, "host." + serverTicket.getName()); host.setAttribute(DE.A_ID, "host." + serverTicket.getName()); //$NON-NLS-1$
_dataStore.getHashMap().put(host.getId(), host); _dataStore.getHashMap().put(host.getId(), host);
_dataStore.update(host); _dataStore.update(host);
@ -312,9 +312,9 @@ public class ServerCommandHandler extends CommandHandler
{ {
DataElement element = (DataElement)lastCreated.get(i); DataElement element = (DataElement)lastCreated.get(i);
statsBuffer.append(element.getName()); statsBuffer.append(element.getName());
statsBuffer.append(":"); statsBuffer.append(":"); //$NON-NLS-1$
statsBuffer.append("id="+element.getId()); statsBuffer.append("id="+element.getId()); //$NON-NLS-1$
statsBuffer.append(";"); statsBuffer.append(";"); //$NON-NLS-1$
} }
@ -346,7 +346,7 @@ public class ServerCommandHandler extends CommandHandler
{ {
Miner miner = (Miner) miners.get(j); Miner miner = (Miner) miners.get(j);
if (commandSource.equals("*") || commandSource.equals(miner.getClass().getName())) if (commandSource.equals("*") || commandSource.equals(miner.getClass().getName())) //$NON-NLS-1$
{ {
if (_dataStore.isAutoRefreshOn()) if (_dataStore.isAutoRefreshOn())
{ {
@ -404,7 +404,7 @@ public class ServerCommandHandler extends CommandHandler
*/ */
public void sendFile(String fileName, byte[] bytes, int size, boolean binary) public void sendFile(String fileName, byte[] bytes, int size, boolean binary)
{ {
sendFile(fileName, bytes, size, binary, "default"); sendFile(fileName, bytes, size, binary, "default"); //$NON-NLS-1$
} }
/** /**
@ -429,7 +429,7 @@ public class ServerCommandHandler extends CommandHandler
*/ */
public void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary) public void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary)
{ {
sendAppendFile(fileName, bytes, size, binary, "default"); sendAppendFile(fileName, bytes, size, binary, "default"); //$NON-NLS-1$
} }
/** /**
@ -452,7 +452,7 @@ public class ServerCommandHandler extends CommandHandler
*/ */
public synchronized void sendClass(String className) public synchronized void sendClass(String className)
{ {
sendClass(className, "default"); sendClass(className, "default"); //$NON-NLS-1$
} }
/** /**

View file

@ -303,6 +303,7 @@ public class ServerLauncher extends Thread {
{ {
"java", //$NON-NLS-1$ "java", //$NON-NLS-1$
"-DA_PLUGIN_PATH=" + _path, //$NON-NLS-1$ "-DA_PLUGIN_PATH=" + _path, //$NON-NLS-1$
"-DDSTORE_SPIRIT_ON=true", //$NON-NLS-1$
"org.eclipse.dstore.core.server.Server", //$NON-NLS-1$ "org.eclipse.dstore.core.server.Server", //$NON-NLS-1$
_port, _port,
timeout, timeout,
@ -415,13 +416,15 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$ System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$
System.exit(-1); System.exit(-1);
} }
else
{
_path = pluginPath.trim(); _path = pluginPath.trim();
_connections = new ArrayList(); _connections = new ArrayList();
init(DEFAULT_DAEMON_PORT + ""); //$NON-NLS-1$ init(DEFAULT_DAEMON_PORT + ""); //$NON-NLS-1$
} }
}
/** /**
* Constructor * Constructor
@ -435,12 +438,14 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$ System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$
System.exit(-1); System.exit(-1);
} }
else
{
_path = pluginPath.trim(); _path = pluginPath.trim();
_connections = new ArrayList(); _connections = new ArrayList();
init(portStr); init(portStr);
} }
}
/** /**
* Constructor * Constructor
@ -456,13 +461,15 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$ System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$
System.exit(-1); System.exit(-1);
} }
else
{
_path = pluginPath.trim(); _path = pluginPath.trim();
_serverPortRange = serverPortRange; _serverPortRange = serverPortRange;
_connections = new ArrayList(); _connections = new ArrayList();
init(portStr); init(portStr);
} }
}
private String getKeyStoreLocation() { private String getKeyStoreLocation() {
return _sslProperties.getDaemonKeyStorePath(); return _sslProperties.getDaemonKeyStorePath();
@ -522,14 +529,14 @@ public class ServerLauncher extends Thread {
} }
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
System.err System.err
.println("Networking problem, can't resolve local host"); .println("Networking problem, can't resolve local host"); //$NON-NLS-1$
e.printStackTrace(); e.printStackTrace();
System.exit(-1); System.exit(-1);
} catch (BindException e) { } catch (BindException e) {
System.err.println("socket taken on " + i); //$NON-NLS-1$ System.err.println("socket taken on " + i); //$NON-NLS-1$
// keep going // keep going
} catch (IOException e) { } catch (IOException e) {
System.err.println("Failure to create ServerSocket"); System.err.println("Failure to create ServerSocket"); //$NON-NLS-1$
e.printStackTrace(); e.printStackTrace();
System.exit(-1); System.exit(-1);
} }
@ -560,11 +567,11 @@ public class ServerLauncher extends Thread {
+ port); + port);
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
System.err System.err
.println("Networking problem, can't resolve local host"); .println("Networking problem, can't resolve local host"); //$NON-NLS-1$
e.printStackTrace(); e.printStackTrace();
System.exit(-1); System.exit(-1);
} catch (IOException e) { } catch (IOException e) {
System.err.println("Failure to create ServerSocket"); System.err.println("Failure to create ServerSocket"); //$NON-NLS-1$
e.printStackTrace(); e.printStackTrace();
System.exit(-1); System.exit(-1);
} }
@ -625,7 +632,7 @@ public class ServerLauncher extends Thread {
_connections.add(listener); _connections.add(listener);
} }
} catch (IOException ioe) { } catch (IOException ioe) {
System.err.println("Server: error initializing socket: " + ioe); System.err.println("Server: error initializing socket: " + ioe); //$NON-NLS-1$
System.exit(-1); System.exit(-1);
} }
} }

View file

@ -59,7 +59,7 @@ public class ServerReceiver extends Receiver
DataElement log = _dataStore.getLogRoot(); DataElement log = _dataStore.getLogRoot();
log.addNestedData(rootOutput, false); log.addNestedData(rootOutput, false);
if (rootOutput.getName().equals("C_EXIT")) if (rootOutput.getName().equals("C_EXIT")) //$NON-NLS-1$
{ {
finish(); finish();
@ -82,7 +82,7 @@ public class ServerReceiver extends Receiver
*/ */
public void handleError(Throwable e) public void handleError(Throwable e)
{ {
System.out.println("RECEIVER ERROR"); System.out.println("RECEIVER ERROR"); //$NON-NLS-1$
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e); System.out.println(e);
_connection.finished(this); _connection.finished(this);

View file

@ -24,16 +24,16 @@ public class ServerReturnCodes
{ {
public static final String RC_DSTORE_SERVER_MAGIC = "Dstore Server Starting..."; //$NON-NLS-1$ public static final String RC_DSTORE_SERVER_MAGIC = "Dstore Server Starting..."; //$NON-NLS-1$
public static final String RC_SUCCESS = "Server Started Successfully"; public static final String RC_SUCCESS = "Server Started Successfully"; //$NON-NLS-1$
public static final String RC_UNKNOWN_HOST_ERROR = "Unknown host error"; public static final String RC_UNKNOWN_HOST_ERROR = "Unknown host error"; //$NON-NLS-1$
public static final String RC_BIND_ERROR = "Error binding socket"; public static final String RC_BIND_ERROR = "Error binding socket"; //$NON-NLS-1$
public static final String RC_GENERAL_IO_ERROR = "General IO error creating socket"; public static final String RC_GENERAL_IO_ERROR = "General IO error creating socket"; //$NON-NLS-1$
public static final String RC_CONNECTION_ERROR = "Connection error"; public static final String RC_CONNECTION_ERROR = "Connection error"; //$NON-NLS-1$
public static final String RC_SECURITY_ERROR = "Security error creating socket"; public static final String RC_SECURITY_ERROR = "Security error creating socket"; //$NON-NLS-1$
public static final String RC_FINISHED = "Server Finished"; public static final String RC_FINISHED = "Server Finished"; //$NON-NLS-1$
public static final String RC_JRE_VERSION_ERROR = "JRE 1.4 or higher required"; public static final String RC_JRE_VERSION_ERROR = "JRE 1.4 or higher required"; //$NON-NLS-1$
} }

View file

@ -33,27 +33,27 @@ public class ServerSSLProperties implements ISSLProperties
private String _serverKeyStorePassword; private String _serverKeyStorePassword;
private static final String ENABLE_SSL = "enable_ssl"; private static final String ENABLE_SSL = "enable_ssl"; //$NON-NLS-1$
private static final String DISABLE_SERVER_SSL = "disable_server_ssl"; private static final String DISABLE_SERVER_SSL = "disable_server_ssl"; //$NON-NLS-1$
private static final String DAEMON_KEYSTORE_FILE = "daemon_keystore_file"; private static final String DAEMON_KEYSTORE_FILE = "daemon_keystore_file"; //$NON-NLS-1$
private static final String DAEMON_KEYSTORE_PASSWORD = "daemon_keystore_password"; private static final String DAEMON_KEYSTORE_PASSWORD = "daemon_keystore_password"; //$NON-NLS-1$
private static final String SERVER_KEYSTORE_FILE = "server_keystore_file"; private static final String SERVER_KEYSTORE_FILE = "server_keystore_file"; //$NON-NLS-1$
private static final String SERVER_KEYSTORE_PASSWORD = "server_keystore_password"; private static final String SERVER_KEYSTORE_PASSWORD = "server_keystore_password"; //$NON-NLS-1$
public ServerSSLProperties() public ServerSSLProperties()
{ {
try try
{ {
ResourceBundle properties = ResourceBundle.getBundle("ssl"); ResourceBundle properties = ResourceBundle.getBundle("ssl"); //$NON-NLS-1$
_enableSSL = properties.getString(ENABLE_SSL).trim().equals("true"); _enableSSL = properties.getString(ENABLE_SSL).trim().equals("true"); //$NON-NLS-1$
if (_enableSSL) if (_enableSSL)
{ {
try try
{ {
_disableServerSSL = properties.getString(DISABLE_SERVER_SSL).trim().equals("true"); _disableServerSSL = properties.getString(DISABLE_SERVER_SSL).trim().equals("true"); //$NON-NLS-1$
} }
catch (Exception e) catch (Exception e)
{ {
@ -96,13 +96,13 @@ public class ServerSSLProperties implements ISSLProperties
if (_enableSSL) if (_enableSSL)
{ {
System.out.println("SSL Settings"); System.out.println("SSL Settings"); //$NON-NLS-1$
System.out.println("[daemon keystore:\t"+_daemonKeyStorePath+"]"); System.out.println("[daemon keystore:\t"+_daemonKeyStorePath+"]"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println("[daemon keystore pw:\t"+_daemonKeyStorePassword+"]"); System.out.println("[daemon keystore pw:\t"+_daemonKeyStorePassword+"]"); //$NON-NLS-1$ //$NON-NLS-2$
if (!_disableServerSSL) if (!_disableServerSSL)
{ {
System.out.println("[server keystore:\t"+_serverKeyStorePath+"]"); System.out.println("[server keystore:\t"+_serverKeyStorePath+"]"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println("[server keystore pw:\t"+_serverKeyStorePassword+"]"); System.out.println("[server keystore pw:\t"+_serverKeyStorePassword+"]"); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }
} }

View file

@ -46,73 +46,73 @@ public class ServerUpdateHandler extends UpdateHandler
private static String[] _keepAliveAttributes = { private static String[] _keepAliveAttributes = {
DataStoreResources.KEEPALIVE_TYPE, DataStoreResources.KEEPALIVE_TYPE,
"server.keepalive.root.id", "server.keepalive.root.id", //$NON-NLS-1$
"server.keepalive", "server.keepalive", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _confirmKeepAliveAttributes = { private static String[] _confirmKeepAliveAttributes = {
DataStoreResources.KEEPALIVECONFIRM_TYPE, DataStoreResources.KEEPALIVECONFIRM_TYPE,
"server.keepalive.confirm.root.id", "server.keepalive.confirm.root.id", //$NON-NLS-1$
"server.confirmkeepalive", "server.confirmkeepalive", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _docAttributes = { private static String[] _docAttributes = {
DataStoreResources.DOCUMENT_TYPE, DataStoreResources.DOCUMENT_TYPE,
"server.doc.root.id", "server.doc.root.id", //$NON-NLS-1$
"server.document", "server.document", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _fileAttributes = { private static String[] _fileAttributes = {
DataStoreResources.FILE_TYPE, DataStoreResources.FILE_TYPE,
"server.file.root.id", "server.file.root.id", //$NON-NLS-1$
"server.file", "server.file", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _classAttributes = { private static String[] _classAttributes = {
DataStoreResources.CLASS_TYPE, DataStoreResources.CLASS_TYPE,
"server.class.root.id", "server.class.root.id", //$NON-NLS-1$
"server.class", "server.class", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _requestClassAttributes = { private static String[] _requestClassAttributes = {
DataStoreResources.REQUEST_CLASS_TYPE, DataStoreResources.REQUEST_CLASS_TYPE,
"server.requestclass.root.id", "server.requestclass.root.id", //$NON-NLS-1$
"server.requestclass", "server.requestclass", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
private static String[] _serializeAttributes = { private static String[] _serializeAttributes = {
DataStoreResources.SERIALIZED_TYPE, DataStoreResources.SERIALIZED_TYPE,
"server.serialized.root.id", "server.serialized.root.id", //$NON-NLS-1$
"server.serialized", "server.serialized", //$NON-NLS-1$
"doc", "doc", //$NON-NLS-1$
"", "", //$NON-NLS-1$
"", "", //$NON-NLS-1$
DataStoreResources.FALSE, DataStoreResources.FALSE,
"2"}; "2"}; //$NON-NLS-1$
protected DataElement _fileDocumentElement; protected DataElement _fileDocumentElement;
protected DataElement _docDocumentElement; protected DataElement _docDocumentElement;
@ -276,7 +276,7 @@ public class ServerUpdateHandler extends UpdateHandler
document.setUpdated(true); document.setUpdated(true);
document.setParent(null); document.setParent(null);
DataElement response = _commandGenerator.generateResponse(document, _dataObjects); _commandGenerator.generateResponse(document, _dataObjects);
for (int j = 0; j < _senders.size(); j++) for (int j = 0; j < _senders.size(); j++)
{ {
@ -337,7 +337,7 @@ public class ServerUpdateHandler extends UpdateHandler
if (sender.socket() == socket) if (sender.socket() == socket)
{ {
// sender sends last ack before death // sender sends last ack before death
DataElement document = _dataStore.createObject(null, DataStoreResources.DOCUMENT_TYPE, "exit", "exit"); DataElement document = _dataStore.createObject(null, DataStoreResources.DOCUMENT_TYPE, "exit", "exit"); //$NON-NLS-1$ //$NON-NLS-2$
sender.sendDocument(document, 2); sender.sendDocument(document, 2);
removeSender(sender); removeSender(sender);
} }
@ -427,15 +427,15 @@ public class ServerUpdateHandler extends UpdateHandler
*/ */
public synchronized void sendClass(String className) public synchronized void sendClass(String className)
{ {
sendClass(className, "default"); sendClass(className, "default"); //$NON-NLS-1$
} }
public void sendKeepAliveRequest() public void sendKeepAliveRequest()
{ {
DataElement document = _keepAliveDocumentElement; DataElement document = _keepAliveDocumentElement;
document.setPendingTransfer(true); document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "request"); document.setAttribute(DE.A_NAME, "request"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "request"); document.setAttribute(DE.A_VALUE, "request"); //$NON-NLS-1$
document.setParent(null); document.setParent(null);
_pendingKeepAliveRequest = document; _pendingKeepAliveRequest = document;
notifyInput(); notifyInput();
@ -445,8 +445,8 @@ public class ServerUpdateHandler extends UpdateHandler
{ {
DataElement document = _confirmKeepAliveDocumentElement; DataElement document = _confirmKeepAliveDocumentElement;
document.setPendingTransfer(true); document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "confirm"); document.setAttribute(DE.A_NAME, "confirm"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "confirm"); document.setAttribute(DE.A_VALUE, "confirm"); //$NON-NLS-1$
document.setParent(null); document.setParent(null);
_pendingKeepAliveConfirmation = document; _pendingKeepAliveConfirmation = document;
notifyInput(); notifyInput();

View file

@ -63,24 +63,16 @@ public class CommandGenerator
{ {
try try
{ {
// prevent duplicate queries
String name = commandObject.getAttribute(DE.A_NAME);
// create time and status objects // create time and status objects
DataElement status = null;
if (status == null)
{
StringBuffer id = new StringBuffer(commandObject.getId()); StringBuffer id = new StringBuffer(commandObject.getId());
id.append(DataStoreResources.model_status); id.append(DataStoreResources.model_status);
status =
_dataStore.createObject( _dataStore.createObject(
commandObject, commandObject,
DataStoreResources.model_status, DataStoreResources.model_status,
DataStoreResources.model_start, DataStoreResources.model_start,
"", "", //$NON-NLS-1$
id.toString()); id.toString());
}
_log.addNestedData(commandObject, false); _log.addNestedData(commandObject, false);
} }
@ -109,7 +101,7 @@ public class CommandGenerator
} }
else else
{ {
System.out.println("not cd -> " + commandDescriptor); System.out.println("not cd -> " + commandDescriptor); //$NON-NLS-1$
return null; return null;
} }
} }
@ -147,7 +139,6 @@ public class CommandGenerator
if (commandObject != null) if (commandObject != null)
{ {
clearDeleted(dataObject); clearDeleted(dataObject);
DataElement tempRoot = _dataStore.getTempRoot();
commandObject.setAttribute(DE.A_VALUE, commandDescriptor.getName()); commandObject.setAttribute(DE.A_VALUE, commandDescriptor.getName());
@ -174,7 +165,7 @@ public class CommandGenerator
} }
else else
{ {
_dataStore.createReference(commandObject, arg, "argument"); _dataStore.createReference(commandObject, arg, "argument"); //$NON-NLS-1$
} }
} }
} }
@ -205,7 +196,6 @@ public class CommandGenerator
DataElement commandObject = createCommand(commandDescriptor); DataElement commandObject = createCommand(commandDescriptor);
if (commandObject != null) if (commandObject != null)
{ {
DataElement tempRoot = _dataStore.getTempRoot();
commandObject.setAttribute(DE.A_VALUE, commandDescriptor.getName()); commandObject.setAttribute(DE.A_VALUE, commandDescriptor.getName());
clearDeleted(dataObject); clearDeleted(dataObject);
if ((refArg || dataObject.isUpdated()) && !dataObject.isSpirit()) if ((refArg || dataObject.isUpdated()) && !dataObject.isSpirit())
@ -224,7 +214,7 @@ public class CommandGenerator
} }
else else
{ {
_dataStore.createReference(commandObject, arg, "argument"); _dataStore.createReference(commandObject, arg, "argument"); //$NON-NLS-1$
} }
@ -296,7 +286,7 @@ public class CommandGenerator
{ {
if (dataObject != null) if (dataObject != null)
{ {
DataElement commandObject = _dataStore.createObject(null, "RESPONSE", responseType); DataElement commandObject = _dataStore.createObject(null, "RESPONSE", responseType); //$NON-NLS-1$
commandObject.addNestedData(dataObject, true); commandObject.addNestedData(dataObject, true);
return commandObject; return commandObject;
} }
@ -314,7 +304,7 @@ public class CommandGenerator
*/ */
public DataElement generateResponse(String responseType) public DataElement generateResponse(String responseType)
{ {
DataElement commandObject = _dataStore.createObject(null, "RESPONSE", responseType); DataElement commandObject = _dataStore.createObject(null, "RESPONSE", responseType); //$NON-NLS-1$
return commandObject; return commandObject;
} }
} }

View file

@ -39,8 +39,8 @@ public class DataElementRemover extends Handler
public static final int DEFAULT_INTERVAL_TIME = 60; // in seconds public static final int DEFAULT_INTERVAL_TIME = 60; // in seconds
private int _intervalTime = DEFAULT_INTERVAL_TIME * 1000; private int _intervalTime = DEFAULT_INTERVAL_TIME * 1000;
private int _expiryTime = DEFAULT_EXPIRY_TIME * 1000; private int _expiryTime = DEFAULT_EXPIRY_TIME * 1000;
public static final String EXPIRY_TIME_PROPERTY_NAME = "SPIRIT_EXPIRY_TIME"; public static final String EXPIRY_TIME_PROPERTY_NAME = "SPIRIT_EXPIRY_TIME"; //$NON-NLS-1$
public static final String INTERVAL_TIME_PROPERTY_NAME = "SPIRIT_INTERVAL_TIME"; public static final String INTERVAL_TIME_PROPERTY_NAME = "SPIRIT_INTERVAL_TIME"; //$NON-NLS-1$
public DataElementRemover(DataStore dataStore) public DataElementRemover(DataStore dataStore)
{ {
@ -50,7 +50,7 @@ public class DataElementRemover extends Handler
getTimes(); getTimes();
setWaitTime(_intervalTime); setWaitTime(_intervalTime);
DataElement spiritnode = _dataStore.createObjectDescriptor(_dataStore.getDescriptorRoot(), IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR); DataElement spiritnode = _dataStore.createObjectDescriptor(_dataStore.getDescriptorRoot(), IDataStoreConstants.DATASTORE_SPIRIT_DESCRIPTOR);
_dataStore.createCommandDescriptor(spiritnode, "StartSpirit", "DataElementRemover", IDataStoreConstants.C_START_SPIRIT); _dataStore.createCommandDescriptor(spiritnode, "StartSpirit", "DataElementRemover", IDataStoreConstants.C_START_SPIRIT); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.refresh(_dataStore.getDescriptorRoot()); _dataStore.refresh(_dataStore.getDescriptorRoot());
} }
@ -59,21 +59,21 @@ public class DataElementRemover extends Handler
try try
{ {
String expiryTime = System.getProperty(EXPIRY_TIME_PROPERTY_NAME); String expiryTime = System.getProperty(EXPIRY_TIME_PROPERTY_NAME);
if (expiryTime != null && !expiryTime.equals("")) _expiryTime = Integer.parseInt(expiryTime) * 1000; if (expiryTime != null && !expiryTime.equals("")) _expiryTime = Integer.parseInt(expiryTime) * 1000; //$NON-NLS-1$
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Invalid spirit expiry time property, using default."); System.out.println("Invalid spirit expiry time property, using default."); //$NON-NLS-1$
_expiryTime = DEFAULT_EXPIRY_TIME; _expiryTime = DEFAULT_EXPIRY_TIME;
} }
try try
{ {
String intervalTime = System.getProperty(INTERVAL_TIME_PROPERTY_NAME); String intervalTime = System.getProperty(INTERVAL_TIME_PROPERTY_NAME);
if (intervalTime != null && !intervalTime.equals("")) _intervalTime = Integer.parseInt(intervalTime) * 1000; if (intervalTime != null && !intervalTime.equals("")) _intervalTime = Integer.parseInt(intervalTime) * 1000; //$NON-NLS-1$
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Invalid spirit interval time property, using default."); System.out.println("Invalid spirit interval time property, using default."); //$NON-NLS-1$
_intervalTime = DEFAULT_INTERVAL_TIME; _intervalTime = DEFAULT_INTERVAL_TIME;
} }
} }
@ -114,25 +114,25 @@ public class DataElementRemover extends Handler
{ {
synchronized (_queue) synchronized (_queue)
{ {
_dataStore.memLog(" "); _dataStore.memLog(" "); //$NON-NLS-1$
int disconnected = 0; int disconnected = 0;
if (!_dataStore.isDoSpirit()) if (!_dataStore.isDoSpirit())
{ {
if (_queue.size() > 0) if (_queue.size() > 0)
{ {
_dataStore.memLog("Clearing queue of size " + _queue.size() + ". DSTORE_SPIRIT_ON not set or set to false."); _dataStore.memLog("Clearing queue of size " + _queue.size() + ". DSTORE_SPIRIT_ON not set or set to false."); //$NON-NLS-1$ //$NON-NLS-2$
_queue.clear(); _queue.clear();
} }
_dataStore.memLog("Total heap size: " + Runtime.getRuntime().totalMemory()); _dataStore.memLog("Total heap size: " + Runtime.getRuntime().totalMemory()); //$NON-NLS-1$
_dataStore.memLog("Elements created so far: " + numCreated); _dataStore.memLog("Elements created so far: " + numCreated); //$NON-NLS-1$
_dataStore.memLog("Elements disconnected so far: " + numDisconnected); _dataStore.memLog("Elements disconnected so far: " + numDisconnected); //$NON-NLS-1$
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); _dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); //$NON-NLS-1$
_dataStore.memLog("DataElements GCed so far: " + numGCed); _dataStore.memLog("DataElements GCed so far: " + numGCed); //$NON-NLS-1$
return; return;
} }
_dataStore.memLog("Total heap size before disconnection: " + Runtime.getRuntime().totalMemory()); _dataStore.memLog("Total heap size before disconnection: " + Runtime.getRuntime().totalMemory()); //$NON-NLS-1$
_dataStore.memLog("Size of queue: " + _queue.size()); _dataStore.memLog("Size of queue: " + _queue.size()); //$NON-NLS-1$
while (_queue.size() > 0 && System.currentTimeMillis() - ((QueueItem) _queue.getFirst()).timeStamp > _expiryTime) while (_queue.size() > 0 && System.currentTimeMillis() - ((QueueItem) _queue.getFirst()).timeStamp > _expiryTime)
{ {
@ -150,11 +150,11 @@ public class DataElementRemover extends Handler
} }
_dataStore.getHashMap().remove(toBeDisconnected.getId()); _dataStore.getHashMap().remove(toBeDisconnected.getId());
} }
_dataStore.memLog("Disconnected " + disconnected + " DataElements."); _dataStore.memLog("Disconnected " + disconnected + " DataElements."); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.memLog("Elements created so far: " + numCreated); _dataStore.memLog("Elements created so far: " + numCreated); //$NON-NLS-1$
_dataStore.memLog("Elements disconnected so far: " + numDisconnected); _dataStore.memLog("Elements disconnected so far: " + numDisconnected); //$NON-NLS-1$
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); _dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); //$NON-NLS-1$
_dataStore.memLog("DataElements GCed so far: " + numGCed); _dataStore.memLog("DataElements GCed so far: " + numGCed); //$NON-NLS-1$
} }
} }

View file

@ -67,7 +67,7 @@ public class Pattern
} }
else else
{ {
return new String("null"); return new String("null"); //$NON-NLS-1$
} }
} }
@ -78,7 +78,7 @@ public class Pattern
*/ */
public boolean matches(String compareStr) public boolean matches(String compareStr)
{ {
String currentMatch = new String(""); String currentMatch = new String(""); //$NON-NLS-1$
_subMatches = new ArrayList(); _subMatches = new ArrayList();
int iText = 0; int iText = 0;
@ -97,7 +97,7 @@ public class Pattern
{ {
_subMatches.add(new String(currentMatch)); _subMatches.add(new String(currentMatch));
} }
currentMatch = new String(""); currentMatch = new String(""); //$NON-NLS-1$
if (iPattern >= patternLen) if (iPattern >= patternLen)
{ {

View file

@ -48,7 +48,7 @@ public abstract class Receiver extends Thread
*/ */
public Receiver(Socket socket, DataStore dataStore) public Receiver(Socket socket, DataStore dataStore)
{ {
setName("DStore Receiver"+getName()); setName("DStore Receiver"+getName()); //$NON-NLS-1$
_socket = socket; _socket = socket;
_dataStore = dataStore; _dataStore = dataStore;
_canExit = false; _canExit = false;
@ -118,7 +118,7 @@ public abstract class Receiver extends Thread
if (rootObject != null) if (rootObject != null)
{ {
String type = rootObject.getType(); String type = rootObject.getType();
if (!type.equals("FILE")) if (!type.equals("FILE")) //$NON-NLS-1$
{ {
handleDocument(rootObject); handleDocument(rootObject);

View file

@ -170,7 +170,7 @@ public class Sender implements ISender
InputStream classInStream = null; InputStream classInStream = null;
className = className.replace('.', '/'); className = className.replace('.', '/');
className = className + ".class"; className = className + ".class"; //$NON-NLS-1$
URL classLocation = null; URL classLocation = null;
for (int i = 0; i < loaders.size(); i++) for (int i = 0; i < loaders.size(); i++)
{ {
@ -189,11 +189,7 @@ public class Sender implements ISender
// got a stream to read the classfile. Now read the class into a buffer. // got a stream to read the classfile. Now read the class into a buffer.
BufferedInputStream bufInputStream = new BufferedInputStream(classInStream); BufferedInputStream bufInputStream = new BufferedInputStream(classInStream);
if (bufInputStream == null)
{
generateEmptyClass(classElement);
return; // throw new IOException("BufferedInputStream could not be instantiated on " + className);
}
try try
{ {
int classSize = bufInputStream.available(); int classSize = bufInputStream.available();

View file

@ -48,8 +48,6 @@ public class StringCompare
compareStr = compareStr.toUpperCase(); compareStr = compareStr.toUpperCase();
} }
String currentMatch = new String("");
int iText = 0; int iText = 0;
int iPattern = 0; int iPattern = 0;
int lastStar = 0; int lastStar = 0;

View file

@ -234,7 +234,7 @@ public class XMLgenerator
{ {
if (top == name) if (top == name)
{ {
append("/>"); append("/>"); //$NON-NLS-1$
if (_tagStack.empty()) if (_tagStack.empty())
{ {
_state = CLOSE; _state = CLOSE;
@ -252,7 +252,7 @@ public class XMLgenerator
nextLine(); nextLine();
_indent--; _indent--;
indent(); indent();
append("</"); append("</"); //$NON-NLS-1$
append(name); append(name);
append('>'); append('>');
if (_tagStack.empty()) if (_tagStack.empty())
@ -276,7 +276,7 @@ public class XMLgenerator
append(' '); append(' ');
append(name); append(name);
append("=\""); append("=\""); //$NON-NLS-1$
append(niceValue); append(niceValue);
append('"'); append('"');
} }
@ -284,7 +284,7 @@ public class XMLgenerator
{ {
append(' '); append(' ');
append(name); append(name);
append("=\"\""); append("=\"\""); //$NON-NLS-1$
} }
} }
@ -368,18 +368,18 @@ public class XMLgenerator
{ {
nextLine(); nextLine();
indent(); indent();
append("<Buffer>"); append("<Buffer>"); //$NON-NLS-1$
nextLine(); nextLine();
indent(); indent();
append(text.toString()); append(text.toString());
nextLine(); nextLine();
indent(); indent();
append("</Buffer>"); append("</Buffer>"); //$NON-NLS-1$
} }
} }
else else
{ {
append(""); append(""); //$NON-NLS-1$
} }
} }
else if (_state == EMPTY) else if (_state == EMPTY)
@ -504,11 +504,11 @@ public class XMLgenerator
String tagType = XMLparser.STR_FILE; String tagType = XMLparser.STR_FILE;
if (isAppend) if (isAppend)
{ {
tagType += ".Append"; tagType += ".Append"; //$NON-NLS-1$
} }
if (binary) if (binary)
{ {
tagType += ".Binary"; tagType += ".Binary"; //$NON-NLS-1$
} }
if (object != null) if (object != null)
@ -523,7 +523,7 @@ public class XMLgenerator
addReferenceTypeAttribute(object); addReferenceTypeAttribute(object);
addAttribute(DE.P_DEPTH, "" + size); addAttribute(DE.P_DEPTH, "" + size); //$NON-NLS-1$
addFile(bytes, size, binary); addFile(bytes, size, binary);
endTag(tagType); endTag(tagType);
@ -553,7 +553,7 @@ public class XMLgenerator
addReferenceTypeAttribute(object); addReferenceTypeAttribute(object);
addAttribute(DE.P_DEPTH, "" + size); addAttribute(DE.P_DEPTH, "" + size); //$NON-NLS-1$
addFile(bytes, size, true); addFile(bytes, size, true);
endTag(tagType); endTag(tagType);
@ -594,7 +594,7 @@ public class XMLgenerator
addReferenceTypeAttribute(object); addReferenceTypeAttribute(object);
addAttribute(DE.P_DEPTH, "" + object.depth()); addAttribute(DE.P_DEPTH, "" + object.depth()); //$NON-NLS-1$
addData(object.getBuffer()); addData(object.getBuffer());
object.setUpdated(true); object.setUpdated(true);
@ -659,7 +659,7 @@ public class XMLgenerator
int size = pin.available(); int size = pin.available();
byte[] bytes = new byte[size]; byte[] bytes = new byte[size];
int nRead = pin.read(bytes, 0, size); int nRead = pin.read(bytes, 0, size);
addAttribute(DE.P_DEPTH, "" + nRead); addAttribute(DE.P_DEPTH, "" + nRead); //$NON-NLS-1$
addFile(bytes, nRead, true); addFile(bytes, nRead, true);
outStream.close(); outStream.close();

View file

@ -81,27 +81,27 @@ public class XMLparser
private KeepAliveRequestThread _kart = null; private KeepAliveRequestThread _kart = null;
private KeepAliveRequestThread _initialKart = null; private KeepAliveRequestThread _initialKart = null;
public static String STR_DATAELEMENT = "DataElement"; public static String STR_DATAELEMENT = "DataElement"; //$NON-NLS-1$
public static String STR_BUFFER_START = "<Buffer>"; public static String STR_BUFFER_START = "<Buffer>"; //$NON-NLS-1$
public static String STR_BUFFER_END = "</Buffer>"; public static String STR_BUFFER_END = "</Buffer>"; //$NON-NLS-1$
public static String STR_BUFFER = "Buffer"; public static String STR_BUFFER = "Buffer"; //$NON-NLS-1$
public static String STR_STATUS = "status"; public static String STR_STATUS = "status"; //$NON-NLS-1$
public static String STR_STATUS_DONE = "done"; public static String STR_STATUS_DONE = "done"; //$NON-NLS-1$
public static String STR_STATUS_ALMOST_DONE = "almost done"; public static String STR_STATUS_ALMOST_DONE = "almost done"; //$NON-NLS-1$
public static String STR_FILE = "File"; public static String STR_FILE = "File"; //$NON-NLS-1$
public static String STR_CLASS = "Class"; public static String STR_CLASS = "Class"; //$NON-NLS-1$
public static String STR_REQUEST_CLASS= "RequestClass"; public static String STR_REQUEST_CLASS= "RequestClass"; //$NON-NLS-1$
public static String STR_SERIALIZED = "Serialized"; public static String STR_SERIALIZED = "Serialized"; //$NON-NLS-1$
public static String STR_AMP = "&amp;"; public static String STR_AMP = "&amp;"; //$NON-NLS-1$
public static String STR_QUOTE = "&quot;"; public static String STR_QUOTE = "&quot;"; //$NON-NLS-1$
public static String STR_APOS = "&apos;"; public static String STR_APOS = "&apos;"; //$NON-NLS-1$
public static String STR_LT = "&lt;"; public static String STR_LT = "&lt;"; //$NON-NLS-1$
public static String STR_GT = "&gt;"; public static String STR_GT = "&gt;"; //$NON-NLS-1$
public static String STR_SEMI = "&#59;"; public static String STR_SEMI = "&#59;"; //$NON-NLS-1$
/** /**
@ -196,19 +196,19 @@ public class XMLparser
} }
catch (Error err) catch (Error err)
{ {
System.out.println("error!"); System.out.println("error!"); //$NON-NLS-1$
handlePanic(err); handlePanic(err);
} }
} }
if (_tagType.startsWith("File.Append")) if (_tagType.startsWith("File.Append")) //$NON-NLS-1$
{ {
boolean binary = _tagType.equals("File.Append.Binary"); boolean binary = _tagType.equals("File.Append.Binary"); //$NON-NLS-1$
_dataStore.appendToFile(path, _fileByteBuffer, size, binary, byteStreamHandlerId); _dataStore.appendToFile(path, _fileByteBuffer, size, binary, byteStreamHandlerId);
} }
else else
{ {
boolean binary = _tagType.equals("File.Binary"); boolean binary = _tagType.equals("File.Binary"); //$NON-NLS-1$
_dataStore.saveFile(path, _fileByteBuffer, size, binary, byteStreamHandlerId); _dataStore.saveFile(path, _fileByteBuffer, size, binary, byteStreamHandlerId);
} }
} }
@ -302,9 +302,9 @@ public class XMLparser
if (_firstTime) if (_firstTime)
{ {
_initialKart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT, _dataStore); _initialKart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT);
_firstTime = false; _firstTime = false;
if (VERBOSE_KEEPALIVE) System.out.println("Starting initial KeepAlive thread."); if (VERBOSE_KEEPALIVE) System.out.println("Starting initial KeepAlive thread."); //$NON-NLS-1$
_initialKart.start(); _initialKart.start();
continue; continue;
} }
@ -313,13 +313,13 @@ public class XMLparser
if (!_initialKart.failed()) if (!_initialKart.failed())
{ {
_isKeepAliveCompatible = true; _isKeepAliveCompatible = true;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive compatible."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive compatible."); //$NON-NLS-1$
_initialKart = null; _initialKart = null;
} }
else else
{ {
_isKeepAliveCompatible = false; _isKeepAliveCompatible = false;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive incompatible."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive incompatible."); //$NON-NLS-1$
_initialKart = null; _initialKart = null;
} }
} }
@ -338,14 +338,14 @@ public class XMLparser
if ((_kart != null) && _kart.failed()) if ((_kart != null) && _kart.failed())
{ {
done = true; done = true;
if (_dataStore.isVirtual()) handlePanic(new Exception("KeepAlive request to server wasnt answered in time.")); if (_dataStore.isVirtual()) handlePanic(new Exception("KeepAlive request to server wasnt answered in time.")); //$NON-NLS-1$
else handlePanic(new Exception("KeepAlive request to client wasnt answered in time.")); else handlePanic(new Exception("KeepAlive request to client wasnt answered in time.")); //$NON-NLS-1$
continue; continue;
} }
else else
{ {
_kart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT, _dataStore); _kart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT);
if (VERBOSE_KEEPALIVE) System.out.println("No activity on socket. KeepAlive thread started."); if (VERBOSE_KEEPALIVE) System.out.println("No activity on socket. KeepAlive thread started."); //$NON-NLS-1$
_kart.start(); _kart.start();
continue; continue;
} }
@ -359,7 +359,7 @@ public class XMLparser
if (in == -1) if (in == -1)
{ {
done = true; done = true;
Exception e = new Exception("The connection to the server has been lost."); Exception e = new Exception("The connection to the server has been lost."); //$NON-NLS-1$
handlePanic(e); handlePanic(e);
} }
else else
@ -484,8 +484,8 @@ public class XMLparser
if (_dataStore.getReferenceTag() == null) if (_dataStore.getReferenceTag() == null)
{ {
if (trimmedTag.indexOf(DE.P_ISREF + "=") > -1) _dataStore.setReferenceTag(DE.P_ISREF); if (trimmedTag.indexOf(DE.P_ISREF + "=") > -1) _dataStore.setReferenceTag(DE.P_ISREF); //$NON-NLS-1$
else if (trimmedTag.indexOf(DE.P_REF_TYPE + "=") > -1) _dataStore.setReferenceTag(DE.P_REF_TYPE); else if (trimmedTag.indexOf(DE.P_REF_TYPE + "=") > -1) _dataStore.setReferenceTag(DE.P_REF_TYPE); //$NON-NLS-1$
} }
if (!_tagStack.empty()) if (!_tagStack.empty())
@ -505,11 +505,12 @@ public class XMLparser
else if (_tagType.equals(STR_BUFFER)) else if (_tagType.equals(STR_BUFFER))
{ {
String buffer = convertStringFromXML(xmlTag); String buffer = convertStringFromXML(xmlTag);
if (parent != null)
parent.appendToBuffer(buffer); parent.appendToBuffer(buffer);
} }
else if ((matchTag != null) && trimmedTag.equals(matchTag)) else if ((matchTag != null) && trimmedTag.equals(matchTag))
{ {
if (parent.getType().equals(STR_STATUS)) if (parent != null && parent.getType().equals(STR_STATUS))
{ {
if (parent.getName().equals(STR_STATUS_ALMOST_DONE)) if (parent.getName().equals(STR_STATUS_ALMOST_DONE))
{ {
@ -617,7 +618,7 @@ public class XMLparser
parent = result; parent = result;
if (_isFile && (result != null)) if (_isFile)
{ {
int size = result.depth(); int size = result.depth();
String path = result.getSource(); String path = result.getSource();
@ -628,14 +629,12 @@ public class XMLparser
// older client or server, fall back to default // older client or server, fall back to default
byteStreamHandler = DataStoreResources.DEFAULT_BYTESTREAMHANDLER; byteStreamHandler = DataStoreResources.DEFAULT_BYTESTREAMHANDLER;
} }
if (path != null)
{
readFile(reader, size, path, byteStreamHandler); readFile(reader, size, path, byteStreamHandler);
}
_isFile = false; _isFile = false;
//_dataStore.deleteObject(parent, result); //_dataStore.deleteObject(parent, result);
} }
else if (_isClass && (result != null)) else if (_isClass)
{ {
int size = result.depth(); int size = result.depth();
@ -643,39 +642,39 @@ public class XMLparser
if (result.getName() != null) if (result.getName() != null)
{ {
boolean success = readClass(reader, size, result.getName(), classbyteStreamHandler); readClass(reader, size, result.getName(), classbyteStreamHandler);
} }
_isClass = false; _isClass = false;
} }
else if (_isRequestClass && (result != null)) else if (_isRequestClass)
{ {
result.getDataStore().sendClass(result.getName()); result.getDataStore().sendClass(result.getName());
_isRequestClass = false; _isRequestClass = false;
} }
else if (_isKeepAlive && (result != null)) else if (_isKeepAlive)
{ {
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive request received, sending confirmation."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive request received, sending confirmation."); //$NON-NLS-1$
result.getDataStore().sendKeepAliveConfirmation(); result.getDataStore().sendKeepAliveConfirmation();
_isKeepAlive = false; _isKeepAlive = false;
} }
else if (_isKeepAliveConfirm && (result != null)) else if (_isKeepAliveConfirm )
{ {
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive confirmation received."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive confirmation received."); //$NON-NLS-1$
if (_initialKart != null) _initialKart.interrupt(); if (_initialKart != null) _initialKart.interrupt();
_isKeepAliveConfirm = false; _isKeepAliveConfirm = false;
} }
else if (_isSerialized && (result != null)) else if (_isSerialized)
{ {
int size = result.depth(); int size = result.depth();
String classbyteStreamHandler = result.getSource(); String classbyteStreamHandler = result.getSource();
if (result.getName() != null) if (result.getName() != null)
{ {
boolean success = readInstance(reader, size, classbyteStreamHandler); readInstance(reader, size, classbyteStreamHandler);
} }
_isSerialized = false; _isSerialized = false;
} }
StringBuffer endTag = new StringBuffer("</"); StringBuffer endTag = new StringBuffer("</"); //$NON-NLS-1$
endTag.append(_tagType); endTag.append(_tagType);
endTag.append('>'); endTag.append('>');
_tagStack.push(endTag.toString()); _tagStack.push(endTag.toString());
@ -711,7 +710,7 @@ public class XMLparser
*/ */
protected synchronized DataElement parseTag(String fullTag, DataElement parent) protected synchronized DataElement parseTag(String fullTag, DataElement parent)
{ {
if (!fullTag.startsWith("<")) if (!fullTag.startsWith("<")) //$NON-NLS-1$
return null; return null;
try try
@ -815,15 +814,7 @@ public class XMLparser
{ {
DataElement to = _dataStore.find(origId); DataElement to = _dataStore.find(origId);
if (parent != null)
{
result = _dataStore.createReference(parent, to, attributes[DE.A_TYPE], false); result = _dataStore.createReference(parent, to, attributes[DE.A_TYPE], false);
}
else
{
_dataStore.trace("NULL2!");
}
} }
else else
{ {
@ -840,7 +831,7 @@ public class XMLparser
return null; return null;
} }
if (parent != null && _dataStore.contains(id)) if (_dataStore.contains(id))
{ {
result = _dataStore.find(id); result = _dataStore.find(id);
@ -871,11 +862,7 @@ public class XMLparser
result.setAttributes(attributes); result.setAttributes(attributes);
} }
if (parent == null) if (parent == _rootDataElement)
{
return result;
}
else if (parent == _rootDataElement)
{ {
DataElement rParent = result.getParent(); DataElement rParent = result.getParent();
parent = rParent; parent = rParent;
@ -901,7 +888,7 @@ public class XMLparser
{ {
if (result != _dataStore.getRoot()) if (result != _dataStore.getRoot())
{ {
_dataStore.trace("parent of " + result.getName() + " is NULL!"); _dataStore.trace("parent of " + result.getName() + " is NULL!"); //$NON-NLS-1$ //$NON-NLS-2$
} }
else else
{ {
@ -915,7 +902,7 @@ public class XMLparser
else else
{ {
// new object // new object
if (_dataStore.isVirtual() && parent != null) if (_dataStore.isVirtual())
{ {
result = _dataStore.find(parent, DE.A_NAME, attributes[DE.A_NAME], 1); result = _dataStore.find(parent, DE.A_NAME, attributes[DE.A_NAME], 1);
} }
@ -956,12 +943,12 @@ public class XMLparser
int indexOfSemi = input.indexOf(';'); int indexOfSemi = input.indexOf(';');
if (indexOfAmp >= 0 && indexOfSemi > indexOfAmp) if (indexOfAmp >= 0 && indexOfSemi > indexOfAmp)
{ {
String converted = input.replaceAll(STR_AMP, "&") String converted = input.replaceAll(STR_AMP, "&") //$NON-NLS-1$
.replaceAll(STR_SEMI, ";") .replaceAll(STR_SEMI, ";") //$NON-NLS-1$
.replaceAll(STR_QUOTE, "\"") .replaceAll(STR_QUOTE, "\"") //$NON-NLS-1$
.replaceAll(STR_APOS, "\'") .replaceAll(STR_APOS, "\'") //$NON-NLS-1$
.replaceAll(STR_LT, "<") .replaceAll(STR_LT, "<") //$NON-NLS-1$
.replaceAll(STR_GT, ">"); .replaceAll(STR_GT, ">"); //$NON-NLS-1$
return converted; return converted;
} }
else else
@ -1028,13 +1015,11 @@ public class XMLparser
public class KeepAliveRequestThread extends Thread public class KeepAliveRequestThread extends Thread
{ {
private long _timeout; private long _timeout;
private DataStore _dataStore;
private boolean _failed; private boolean _failed;
public KeepAliveRequestThread(long timeout, DataStore datastore) public KeepAliveRequestThread(long timeout)
{ {
_timeout = timeout; _timeout = timeout;
_dataStore = datastore;
_failed = false; _failed = false;
} }
@ -1047,10 +1032,10 @@ public class XMLparser
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive thread interrupted."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive thread interrupted."); //$NON-NLS-1$
return; return;
} }
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive thread failed to be interrupted."); if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive thread failed to be interrupted."); //$NON-NLS-1$
_failed = true; _failed = true;
} }

View file

@ -64,7 +64,7 @@ public class DStoreKeyStore
/* Do not stomp an existing file */ /* Do not stomp an existing file */
if(!keyStoreFile.exists()) if(!keyStoreFile.exists())
{ {
keyStore = KeyStore.getInstance("JKS"); keyStore = KeyStore.getInstance("JKS"); //$NON-NLS-1$
keyStore.load(null, password.toCharArray()); keyStore.load(null, password.toCharArray());
persistKeyStore(keyStore, filePath, password); persistKeyStore(keyStore, filePath, password);
} }
@ -89,7 +89,7 @@ public class DStoreKeyStore
/* Do not stomp an existing file */ /* Do not stomp an existing file */
if(file.exists()) { if(file.exists()) {
ks=KeyStore.getInstance("JKS"); ks=KeyStore.getInstance("JKS"); //$NON-NLS-1$
/* Initialize the keystore with no information */ /* Initialize the keystore with no information */
FileInputStream is=new FileInputStream(file); FileInputStream is=new FileInputStream(file);
ks.load(is, password.toCharArray()); ks.load(is, password.toCharArray());
@ -102,7 +102,7 @@ public class DStoreKeyStore
throws CertificateException, throws CertificateException,
FileNotFoundException { FileNotFoundException {
CertificateFactory factory=CertificateFactory.getInstance("X.509"); CertificateFactory factory=CertificateFactory.getInstance("X.509"); //$NON-NLS-1$
return factory.generateCertificate(new FileInputStream(certFilename)); return factory.generateCertificate(new FileInputStream(certFilename));
} }

View file

@ -37,7 +37,7 @@ public class DStoreSSLContext
KeyManagerFactory kmf = KeyManagerFactory.getInstance(keymgrAlgorithm); KeyManagerFactory kmf = KeyManagerFactory.getInstance(keymgrAlgorithm);
kmf.init(ks, password.toCharArray()); kmf.init(ks, password.toCharArray());
serverContext = SSLContext.getInstance("SSL"); serverContext = SSLContext.getInstance("SSL"); //$NON-NLS-1$
serverContext.init(kmf.getKeyManagers(), null, null); serverContext.init(kmf.getKeyManagers(), null, null);
} }
catch (Exception e) catch (Exception e)
@ -55,7 +55,7 @@ public class DStoreSSLContext
try try
{ {
trustManager.setKeystore(filePath, password); trustManager.setKeystore(filePath, password);
clientContext = SSLContext.getInstance("SSL"); clientContext = SSLContext.getInstance("SSL"); //$NON-NLS-1$
TrustManager[] mgrs = new TrustManager[1]; TrustManager[] mgrs = new TrustManager[1];
mgrs[0] = trustManager; mgrs[0] = trustManager;

View file

@ -49,7 +49,8 @@ public class PropertySource implements IPropertySource
_descriptors = new IPropertyDescriptor[attributesSize + 2]; _descriptors = new IPropertyDescriptor[attributesSize + 2];
_descriptors[0] = new TextPropertyDescriptor("type", "type"); //$NON-NLS-1$ //$NON-NLS-2$ _descriptors[0] = new TextPropertyDescriptor("type", "type"); //$NON-NLS-1$ //$NON-NLS-2$
_descriptors[1] = new TextPropertyDescriptor("name", "name"); //$NON-NLS-1$ //$NON-NLS-2$ _descriptors[1] = new TextPropertyDescriptor("name", "name"); //$NON-NLS-1$ //$NON-NLS-2$
if (attributes != null)
{
for (int i = 0; i < attributesSize; i++) for (int i = 0; i < attributesSize; i++)
{ {
IDataElement attribute = (IDataElement)attributes.get(i); IDataElement attribute = (IDataElement)attributes.get(i);
@ -64,6 +65,7 @@ public class PropertySource implements IPropertySource
_properties.put(attribute.getName(), type); _properties.put(attribute.getName(), type);
_descriptors[i+2] = new TextPropertyDescriptor(attribute.getName(), attribute.getName()); _descriptors[i+2] = new TextPropertyDescriptor(attribute.getName(), attribute.getName());
} }
}
} }