1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +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
{
String pluginPath = System.getProperty("A_PLUGIN_PATH");
String pluginPath = System.getProperty("A_PLUGIN_PATH"); //$NON-NLS-1$
if ((pluginPath != null) && (pluginPath.length() > 0))
{
setAttribute(A_PLUGIN_PATH, pluginPath + File.separator);
}
setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName());
setAttribute(A_LOCAL_PATH, "/tmp/");
setAttribute(A_HOST_NAME, "local");
setAttribute(A_HOST_PATH, "/");
setAttribute(A_LOCAL_PATH, "/tmp/"); //$NON-NLS-1$
setAttribute(A_HOST_NAME, "local"); //$NON-NLS-1$
setAttribute(A_HOST_PATH, "/"); //$NON-NLS-1$
}
catch (UnknownHostException e)

View file

@ -42,73 +42,73 @@ public class ClientCommandHandler extends CommandHandler
private static String[] _docAttributes = {
DataStoreResources.DOCUMENT_TYPE,
"client.doc.root.id",
"client.document",
"doc",
"",
"",
"client.doc.root.id", //$NON-NLS-1$
"client.document", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _fileAttributes = {
DataStoreResources.FILE_TYPE,
"client.file.root.id",
"client.file",
"doc",
"",
"",
"client.file.root.id", //$NON-NLS-1$
"client.file", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _classAttributes = {
DataStoreResources.CLASS_TYPE,
"client.class.root.id",
"client.class",
"doc",
"",
"",
"client.class.root.id", //$NON-NLS-1$
"client.class", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _serializeAttributes = {
DataStoreResources.SERIALIZED_TYPE,
"client.serialized.root.id",
"client.serialized",
"doc",
"",
"",
"client.serialized.root.id", //$NON-NLS-1$
"client.serialized", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _requestClassAttributes = {
DataStoreResources.REQUEST_CLASS_TYPE,
"client.requestclass.root.id",
"client.requestclass",
"doc",
"",
"",
"client.requestclass.root.id", //$NON-NLS-1$
"client.requestclass", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _keepAliveAttributes = {
DataStoreResources.KEEPALIVE_TYPE,
"client.keepalive.root.id",
"server.keepalive",
"doc",
"",
"",
"client.keepalive.root.id", //$NON-NLS-1$
"server.keepalive", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _confirmKeepAliveAttributes = {
DataStoreResources.KEEPALIVECONFIRM_TYPE,
"client.keepalive.confirm.root.id",
"server.confirmkeepalive",
"doc",
"",
"",
"client.keepalive.confirm.root.id", //$NON-NLS-1$
"server.confirmkeepalive", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
protected DataElement _fileDocumentElement;
@ -170,7 +170,7 @@ public class ClientCommandHandler extends CommandHandler
*/
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)
{
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)
{
sendClass(className, "default");
sendClass(className, "default"); //$NON-NLS-1$
}
/**
@ -353,8 +353,8 @@ public class ClientCommandHandler extends CommandHandler
{
DataElement document = _confirmKeepAliveDocumentElement;
document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "confirm");
document.setAttribute(DE.A_VALUE, "confirm");
document.setAttribute(DE.A_NAME, "confirm"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "confirm"); //$NON-NLS-1$
document.setParent(null);
_pendingKeepAliveConfirmation = document;
notifyInput();
@ -364,8 +364,8 @@ public class ClientCommandHandler extends CommandHandler
{
DataElement document = _keepAliveDocumentElement;
document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "request");
document.setAttribute(DE.A_VALUE, "request");
document.setAttribute(DE.A_NAME, "request"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "request"); //$NON-NLS-1$
document.setParent(null);
_pendingKeepAliveRequest = document;
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_VERSION = 1;
private static final int VERSION_INDEX_MINOR = 2;
public static String INCOMPATIBLE_SERVER_UPDATE = "Incompatible DataStore.";
public static String INCOMPATIBLE_CLIENT_UPDATE = "Incompatible DataStore.";
public static String SERVER_OLDER = "Older DataStore Server.";
public static String CLIENT_OLDER = "Older DataStore Client.";
public static String INCOMPATIBLE_PROTOCOL = "Incompatible Protocol.";
public static String CANNOT_CONNECT = "Cannot connect to server.";
public static String INCOMPATIBLE_SERVER_UPDATE = "Incompatible DataStore."; //$NON-NLS-1$
public static String INCOMPATIBLE_CLIENT_UPDATE = "Incompatible DataStore."; //$NON-NLS-1$
public static String SERVER_OLDER = "Older DataStore Server."; //$NON-NLS-1$
public static String CLIENT_OLDER = "Older DataStore Client."; //$NON-NLS-1$
public static String INCOMPATIBLE_PROTOCOL = "Incompatible Protocol."; //$NON-NLS-1$
public static String CANNOT_CONNECT = "Cannot connect to server."; //$NON-NLS-1$
/**
* Creates a new ClientConnection instance
@ -242,7 +242,7 @@ public class ClientConnection implements IDataStoreConstants
{
if (port == null || port.length() == 0)
{
port = "0";
port = "0"; //$NON-NLS-1$
}
_port = port;
@ -317,7 +317,7 @@ public class ClientConnection implements IDataStoreConstants
if (_isRemote)
{
_commandHandler.command(
_dataStore.find(_dataStore.getRoot(), DE.A_NAME, "Exit"),
_dataStore.find(_dataStore.getRoot(), DE.A_NAME, "Exit"), //$NON-NLS-1$
_dataStore.getHostRoot(),
false);
_receiver.finish();
@ -354,7 +354,7 @@ public class ClientConnection implements IDataStoreConstants
if (_loaders == null)
{
_loaders = new ArrayList();
_loaders.add(new ExternalLoader(getClass().getClassLoader(), "*"));
_loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); //$NON-NLS-1$
}
_commandHandler = new ServerCommandHandler(_loaders);
@ -380,7 +380,7 @@ public class ClientConnection implements IDataStoreConstants
_isConnected = true;
DataElement ticket = _dataStore.getTicket();
ticket.setAttribute(DE.A_NAME, "null");
ticket.setAttribute(DE.A_NAME, "null"); //$NON-NLS-1$
ConnectionStatus result = new ConnectionStatus(_isConnected);
result.setTicket(ticket.getName());
@ -411,7 +411,7 @@ public class ClientConnection implements IDataStoreConstants
else
{
launchStatus = new ConnectionStatus(true);
launchStatus.setTicket("null");
launchStatus.setTicket("null"); //$NON-NLS-1$
}
return connect(launchStatus.getTicket());
@ -472,7 +472,7 @@ public class ClientConnection implements IDataStoreConstants
{
((SSLSocket) _theSocket).startHandshake();
SSLSession session = ((SSLSocket) _theSocket).getSession();
((SSLSocket) _theSocket).getSession();
}
catch (SSLHandshakeException e)
@ -507,44 +507,44 @@ public class ClientConnection implements IDataStoreConstants
case HANDSHAKE_SERVER_NEWER:
{
msg = INCOMPATIBLE_CLIENT_UPDATE;
msg += "\nThe server running on "
msg += "\nThe server running on " //$NON-NLS-1$
+ _host
+ " under port "
+ " under port " //$NON-NLS-1$
+ _port
+ " is a newer DataStore server.";
+ " is a newer DataStore server."; //$NON-NLS-1$
break;
}
case HANDSHAKE_SERVER_OLDER:
{
msg = INCOMPATIBLE_SERVER_UPDATE;
msg += "\nThe server running on "
msg += "\nThe server running on " //$NON-NLS-1$
+ _host
+ " under port "
+ " under port " //$NON-NLS-1$
+ _port
+ " is an older DataStore server.";
+ " is an older DataStore server."; //$NON-NLS-1$
break;
}
case HANDSHAKE_INCORRECT:
{
msg = CANNOT_CONNECT;
msg += INCOMPATIBLE_PROTOCOL;
msg += "\nThe server running on "
msg += "\nThe server running on " //$NON-NLS-1$
+ _host
+ " under port "
+ " under port " //$NON-NLS-1$
+ _port
+ " is not a valid DataStore server.";
+ " is not a valid DataStore server."; //$NON-NLS-1$
break;
}
case HANDSHAKE_UNEXPECTED:
{
msg = CANNOT_CONNECT;
msg += "Unexpected exception.";
msg += "Unexpected exception."; //$NON-NLS-1$
break;
}
case HANDSHAKE_TIMEOUT:
{
msg = CANNOT_CONNECT;
msg += "Timeout waiting for socket activity.";
msg += "Timeout waiting for socket activity."; //$NON-NLS-1$
break;
}
default:
@ -560,8 +560,8 @@ public class ClientConnection implements IDataStoreConstants
}
catch (java.net.ConnectException e)
{
String msg = "Connection Refused.";
msg += "\nMake sure that the DataStore server is running on " + _host + " under port " + _port + ".";
String msg = "Connection Refused."; //$NON-NLS-1$
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);
}
catch (UnknownHostException uhe)
@ -673,7 +673,7 @@ public class ClientConnection implements IDataStoreConstants
}
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);
}
else
@ -771,8 +771,8 @@ public class ClientConnection implements IDataStoreConstants
}
catch (java.net.ConnectException e)
{
String msg = "Connection Refused.";
msg += "\nMake sure that the DataStore daemon is running on " + _host + ".";
String msg = "Connection Refused."; //$NON-NLS-1$
msg += "\nMake sure that the DataStore daemon is running on " + _host + "."; //$NON-NLS-1$ //$NON-NLS-2$
result = new ConnectionStatus(false, msg);
}
catch (UnknownHostException uhe)
@ -825,18 +825,6 @@ public class ClientConnection implements IDataStoreConstants
_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()
{
@ -844,9 +832,9 @@ public class ClientConnection implements IDataStoreConstants
{
BufferedReader reader = new BufferedReader(new InputStreamReader(_theSocket.getInputStream(), DE.ENCODING_UTF_8));
PrintWriter writer = new PrintWriter(new OutputStreamWriter(_theSocket.getOutputStream(), DE.ENCODING_UTF_8));
writer.println("");
writer.println("");
writer.println("");
writer.println(""); //$NON-NLS-1$
writer.println(""); //$NON-NLS-1$
writer.println(""); //$NON-NLS-1$
writer.flush();
String handshake = null;
@ -860,8 +848,8 @@ public class ClientConnection implements IDataStoreConstants
}
_theSocket.setSoTimeout(0);
String[] clientVersionStr = DataStoreAttributes.DATASTORE_VERSION.split("\\.");
String[] serverVersionStr = handshake.split("\\.");
String[] clientVersionStr = DataStoreAttributes.DATASTORE_VERSION.split("\\."); //$NON-NLS-1$
String[] serverVersionStr = handshake.split("\\."); //$NON-NLS-1$
_dataStore.setServerVersion(Integer.parseInt(serverVersionStr[VERSION_INDEX_VERSION]));
_dataStore.setServerMinor(Integer.parseInt(serverVersionStr[VERSION_INDEX_MINOR]));
@ -873,7 +861,7 @@ public class ClientConnection implements IDataStoreConstants
}
else
{
if (handshake.startsWith("<DataElement"))
if (handshake.startsWith("<DataElement")) //$NON-NLS-1$
{
return HANDSHAKE_SERVER_OLDER;
}

View file

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

View file

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

View file

@ -43,7 +43,7 @@ public class ClassByteStreamHandler implements IClassByteStreamHandler
protected DataStore _dataStore;
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

View file

@ -93,7 +93,7 @@ import org.eclipse.dstore.core.model.DataStore;
*/
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 boolean _useCaching = false;
private CacheClassLoader _urlClassLoader;
@ -128,7 +128,7 @@ public class RemoteClassLoader extends ClassLoader
{
boolean useCaching = false;
String pref = _dataStore.getPreference(CACHING_PREFERENCE);
if (pref != null && pref.equals("true"))
if (pref != null && pref.equals("true")) //$NON-NLS-1$
{
useCaching = true;
}
@ -287,7 +287,8 @@ public class RemoteClassLoader extends ClassLoader
// 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("notifying requester");
request.notifyResponse(); // wake up the threads waiting for the class
if (request != null)
request.notifyResponse(); // wake up the threads waiting for the class
return;
}
Class receivedClass = null;
@ -308,7 +309,8 @@ public class RemoteClassLoader extends ClassLoader
// (even after requesting it from the client). We must fail,
// but wake up the threads waiting for this class.
e.printStackTrace();
request.notifyResponse();
if (request != null)
request.notifyResponse();
return;
}
catch (LinkageError e)
@ -327,13 +329,15 @@ public class RemoteClassLoader extends ClassLoader
// so we might as well just fail here and notify threads waiting
// for this class to load.
err.printStackTrace();
request.notifyResponse();
if (request != null)
request.notifyResponse();
return;
}
catch (ClassNotFoundException ee)
{
// we definitely shouldnt get here
request.notifyResponse();
if (request != null)
request.notifyResponse();
return;
}
@ -341,7 +345,8 @@ public class RemoteClassLoader extends ClassLoader
// we still dont have it, notify the threads and fail.
if (receivedClass == null)
{
request.notifyResponse();
if (request != null)
request.notifyResponse();
return;
}
}

View file

@ -190,7 +190,7 @@ implements ISchemaExtender
if (_value == null)
{
String name = getMinerName();
int indexOfValue = name.lastIndexOf(".");
int indexOfValue = name.lastIndexOf("."); //$NON-NLS-1$
_value = name.substring(indexOfValue + 1, name.length());
}
return _value;
@ -256,17 +256,16 @@ implements ISchemaExtender
{
String name = getCommandName(command);
DataElement status = getCommandStatus(command);
long startTime = System.currentTimeMillis();
if (status == null)
{
_dataStore.trace("bad command: ");
_dataStore.trace("\tcmd=" + command);
_dataStore.trace("\tparent=" + command.getParent());
_dataStore.trace("bad command: "); //$NON-NLS-1$
_dataStore.trace("\tcmd=" + command); //$NON-NLS-1$
_dataStore.trace("\tparent=" + command.getParent()); //$NON-NLS-1$
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);
}
@ -285,7 +284,7 @@ implements ISchemaExtender
{
//e.printStackTrace();
_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_SOURCE, getStack(e));
_dataStore.refresh(status);
@ -294,8 +293,8 @@ implements ISchemaExtender
if (e.getMessage() != null)
exc = e.getMessage();
else
exc = "Exception";
DataElement exception = _dataStore.createObject(status, DataStoreResources.model_error, exc);
exc = "Exception"; //$NON-NLS-1$
_dataStore.createObject(status, DataStoreResources.model_error, exc);
}
catch (Error er)
{
@ -316,8 +315,8 @@ implements ISchemaExtender
StackTraceElement[] stack = e.getStackTrace();
for (int i = 0; i < stack.length; i++)
{
buf.append(stack[i].getClassName() + ":" + stack[i].getMethodName() + ":" + stack[i].getLineNumber());
buf.append(",");
buf.append(stack[i].getClassName() + ":" + stack[i].getMethodName() + ":" + stack[i].getLineNumber()); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(","); //$NON-NLS-1$
}
return buf.toString();
}
@ -501,7 +500,7 @@ implements ISchemaExtender
*/
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 DataElement _log;
protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006";
protected static final String FILEMSG_REMOTE_SAVE_FAILED = "RSEF5006"; //$NON-NLS-1$
/**
* Contructor
@ -118,7 +118,7 @@ public class ByteStreamHandler implements IByteStreamHandler
fileStream.close();
if (status == null)
return;
status.setAttribute(DE.A_SOURCE, "success");
status.setAttribute(DE.A_SOURCE, "success"); //$NON-NLS-1$
_dataStore.refresh(status.getParent());
}
catch (IOException e)
@ -127,7 +127,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null)
return;
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());
}
catch (Exception e)
@ -136,7 +136,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null)
return;
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());
}
}
@ -214,7 +214,7 @@ public class ByteStreamHandler implements IByteStreamHandler
}
if (status == null)
return;
status.setAttribute(DE.A_SOURCE, "success");
status.setAttribute(DE.A_SOURCE, "success"); //$NON-NLS-1$
_dataStore.refresh(status.getParent());
}
catch (IOException e)
@ -223,7 +223,7 @@ public class ByteStreamHandler implements IByteStreamHandler
if (status == null)
return;
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());
}
}

View file

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

View file

@ -38,146 +38,146 @@ public class DE
/*
* 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
* 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>.
*/
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>.
*/
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
* 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>.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
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.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
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>.
*/
public static final String P_DESCRIPTOR = "descriptor";
public static final String P_DESCRIPTOR = "descriptor"; //$NON-NLS-1$
/*
* Reference type.
*/
public static final String T_REFERENCE = "reference";
public static final String T_REFERENCE = "reference"; //$NON-NLS-1$
/*
* Command type.
*/
public static final String T_COMMAND = "command";
public static final String T_COMMAND = "command"; //$NON-NLS-1$
/*
* 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.
*/
public static final String T_OBJECT_DESCRIPTOR = "objectdescriptor";
public static final String T_OBJECT_DESCRIPTOR = "objectdescriptor"; //$NON-NLS-1$
/*
* 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.
*/
public static final String T_RELATION_DESCRIPTOR = "relationdescriptor";
public static final String T_RELATION_DESCRIPTOR = "relationdescriptor"; //$NON-NLS-1$
/*
* 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.
*/
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.
*/
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 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);
if (depthStr != null && depthStr.length() > 0)
{
if (!depthStr.equals("2"))
if (!depthStr.equals("2")) //$NON-NLS-1$
{
try
{
@ -902,7 +902,7 @@ public final class DataElement implements IDataElement
public void setDepth(int depth)
{
_depth = depth;
setAttribute(DE.A_DEPTH, "" + _depth);
setAttribute(DE.A_DEPTH, "" + _depth); //$NON-NLS-1$
_isUpdated = false;
//_dataStore.refresh(this);
}
@ -975,7 +975,7 @@ public final class DataElement implements IDataElement
String typeName = type.getName();
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;
return result;
@ -989,12 +989,13 @@ public final class DataElement implements IDataElement
{
abstracted = descriptor.getAssociated(relationship);
}
for (int i = 0;(i < abstracted.size()) && !result; i++)
if (abstracted != null)
{
DataElement superDescriptor = (DataElement) abstracted.get(i);
result = superDescriptor.isOfType(type, true);
for (int i = 0;(i < abstracted.size()) && !result; i++)
{
DataElement superDescriptor = (DataElement) abstracted.get(i);
result = superDescriptor.isOfType(type, true);
}
}
}
@ -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)
{
@ -1415,23 +1416,23 @@ public final class DataElement implements IDataElement
*/
public String toString()
{
return "DataElement "
+ (_isReference ? "reference" : "")
+ "\n{\n\tType:\t"
return "DataElement " //$NON-NLS-1$
+ (_isReference ? "reference" : "") //$NON-NLS-1$ //$NON-NLS-2$
+ "\n{\n\tType:\t" //$NON-NLS-1$
+ getType()
+ "\n\tName:\t"
+ "\n\tName:\t" //$NON-NLS-1$
+ getName()
+ "\n\tValue:\t"
+ "\n\tValue:\t" //$NON-NLS-1$
+ getValue()
+ "\n\tID:\t"
+ "\n\tID:\t" //$NON-NLS-1$
+ getId()
+ "\n\tSource:\t"
+ "\n\tSource:\t" //$NON-NLS-1$
+ getSource()
+ "\n\tDepth:\t"
+ "\n\tDepth:\t" //$NON-NLS-1$
+ _depth
+ "\n\tDataStore:\t"
+ "\n\tDataStore:\t" //$NON-NLS-1$
+ _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))
{
String source = getAttribute(DE.A_SOURCE);
int locationIndex = source.lastIndexOf(":");
int locationIndex = source.lastIndexOf(":"); //$NON-NLS-1$
if (locationIndex > 3)
{
return source.substring(0, locationIndex);
@ -1556,7 +1557,7 @@ public final class DataElement implements IDataElement
String depthStr = getAttribute(DE.A_DEPTH);
if (depthStr != null && depthStr.length() > 0)
{
if (!depthStr.equals("2"))
if (!depthStr.equals("2")) //$NON-NLS-1$
{
try
{

View file

@ -134,8 +134,8 @@ public final class DataStore
private HashMap _classReqRepository;
private File _cacheJar;
public static final String REMOTE_CLASS_CACHE_JARFILE_NAME = "rmt_classloader_cache";
public static final String JARFILE_EXTENSION = ".jar";
public static final String REMOTE_CLASS_CACHE_JARFILE_NAME = "rmt_classloader_cache"; //$NON-NLS-1$
public static final String JARFILE_EXTENSION = ".jar"; //$NON-NLS-1$
private DataElementRemover _deRemover;
public static final int SPIRIT_ON_INITIAL_SIZE = 1000;
private String referenceTag = null;
@ -232,8 +232,8 @@ public final class DataStore
if (isVirtual()) _spiritModeOn = true;
else
{
String doSpirit = System.getProperty("DSTORE_SPIRIT_ON");
_spiritModeOn = (doSpirit != null && doSpirit.equals("true"));
String doSpirit = System.getProperty("DSTORE_SPIRIT_ON"); //$NON-NLS-1$
_spiritModeOn = (doSpirit != null && doSpirit.equals("true")); //$NON-NLS-1$
}
}
@ -357,7 +357,7 @@ public final class DataStore
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);
ArrayList args = new ArrayList();
args.add(location);
@ -807,12 +807,12 @@ public final class DataStore
DataStoreResources.model_root,
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_ROOT_NAME),
_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();
initializeDescriptors();
@ -1114,7 +1114,7 @@ public final class DataStore
*/
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)
{
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)
{
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);
return descriptor;
}
@ -1366,11 +1366,11 @@ public final class DataStore
DataElement descriptor = 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
{
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);
return descriptor;
@ -1409,7 +1409,7 @@ public final class DataStore
*/
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);
return descriptor;
}
@ -1438,7 +1438,7 @@ public final class DataStore
*/
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);
return descriptor;
}
@ -1482,7 +1482,7 @@ public final class DataStore
*/
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);
_cmdDescriptorMap.put(value, cmd);
return cmd;
@ -1533,11 +1533,11 @@ public final class DataStore
DataElement cmd = 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
{
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);
_cmdDescriptorMap.put(value, cmd);
@ -2049,7 +2049,7 @@ public final class DataStore
DataElement cmd = findCommandDescriptor(DataStoreSchema.C_SET_PREFERENCE);
if (cmd != null)
{
DataElement prefObj = createObject(null, "preference", property);
DataElement prefObj = createObject(null, "preference", property); //$NON-NLS-1$
prefObj.setAttribute(DE.A_VALUE, value);
command(cmd, prefObj, true);
}
@ -2169,7 +2169,7 @@ public final class DataStore
{
if (ticketStr == null)
{
ticketStr = "null";
ticketStr = "null"; //$NON-NLS-1$
}
return createObject(_tempRoot, DataStoreResources.model_ticket, ticketStr);
}
@ -2179,7 +2179,7 @@ public final class DataStore
DataElement cmd = findCommandDescriptor(DataStoreSchema.C_VALIDATE_TICKET);
DataElement status = _commandHandler.command(cmd, ticket, false);
if (ticket.getName().equals("null"))
if (ticket.getName().equals("null")) //$NON-NLS-1$
{
return null;
}
@ -2240,7 +2240,7 @@ public final class DataStore
startWaiting(status);
while ((status != null)
&& (_status == null || _status.getName().equals("okay"))
&& (_status == null || _status.getName().equals("okay")) //$NON-NLS-1$
&& !status.getName().equals(state)
&& !status.getValue().equals(state)
&& !status.getName().equals(DataStoreResources.model_incomplete)
@ -2268,7 +2268,8 @@ public final class DataStore
if (timedOut)
{
status.setAttribute(DE.A_NAME, DataStoreResources.model_timeout);
if (status != null)
status.setAttribute(DE.A_NAME, DataStoreResources.model_timeout);
}
}
@ -3402,12 +3403,12 @@ public final class DataStore
{
if (_userPreferencesDirectory == null) {
_userPreferencesDirectory = System.getProperty("user.home");
_userPreferencesDirectory = System.getProperty("user.home"); //$NON-NLS-1$
String clientUserID = System.getProperty("client.username");
if (clientUserID == null || clientUserID.equals(""))
String clientUserID = System.getProperty("client.username"); //$NON-NLS-1$
if (clientUserID == null || clientUserID.equals("")) //$NON-NLS-1$
{
clientUserID = "";
clientUserID = ""; //$NON-NLS-1$
}
else
{
@ -3421,8 +3422,8 @@ public final class DataStore
_userPreferencesDirectory = _userPreferencesDirectory + File.separator;
}
_userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator +
"RSE" + File.separator + clientUserID;
_userPreferencesDirectory = _userPreferencesDirectory + ".eclipse" + File.separator + //$NON-NLS-1$
"RSE" + File.separator + clientUserID; //$NON-NLS-1$
File dirFile = new File(_userPreferencesDirectory);
if (!dirFile.exists()) {
dirFile.mkdirs();
@ -3453,8 +3454,8 @@ public final class DataStore
_dataStoreSchema = new DataStoreSchema(this);
String tracingProperty = System.getProperty("DSTORE_TRACING_ON");
if (tracingProperty != null && tracingProperty.equals("true"))
String tracingProperty = System.getProperty("DSTORE_TRACING_ON"); //$NON-NLS-1$
if (tracingProperty != null && tracingProperty.equals("true")) //$NON-NLS-1$
{
_tracingOn = true;
}
@ -3465,11 +3466,11 @@ public final class DataStore
if (_tracingOn)
{
String logDir = getUserPreferencesDirectory();
_traceFileHandle = new File(logDir, ".dstoreTrace");
_traceFileHandle = new File(logDir, ".dstoreTrace"); //$NON-NLS-1$
try
{
_traceFile = new RandomAccessFile(_traceFileHandle, "rw");
_traceFile = new RandomAccessFile(_traceFileHandle, "rw"); //$NON-NLS-1$
startTracing();
}
catch (IOException e)
@ -3496,17 +3497,17 @@ public final class DataStore
{
if (!isVirtual() && _deRemover == null)
{
String memLogging = System.getProperty("DSTORE_MEMLOGGING_ON");
_memLoggingOn = (memLogging != null && memLogging.equals("true"));
String memLogging = System.getProperty("DSTORE_MEMLOGGING_ON"); //$NON-NLS-1$
_memLoggingOn = (memLogging != null && memLogging.equals("true")); //$NON-NLS-1$
if (_memLoggingOn)
{
String logDir = getUserPreferencesDirectory();
_memLoggingFileHandle = new File(logDir, ".dstoreMemLogging");
_memLoggingFileHandle = new File(logDir, ".dstoreMemLogging"); //$NON-NLS-1$
try
{
_memLogFile = new RandomAccessFile(_memLoggingFileHandle, "rw");
_memLogFile = new RandomAccessFile(_memLoggingFileHandle, "rw"); //$NON-NLS-1$
startMemLogging();
}
catch (IOException e)
@ -3722,13 +3723,13 @@ public final class DataStore
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");
_dummy = createObject(_root, "temp", "dummy");
_logRoot = createObject(_root, DataStoreResources.model_log, DataStoreResources.model_Log_Root, "", "logID");
_tempRoot = createObject(_root, "temp", "Temp Root", "", "tempID"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
_dummy = createObject(_root, "temp", "dummy"); //$NON-NLS-1$ //$NON-NLS-2$
_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 =
createObject(
@ -3736,9 +3737,9 @@ public final class DataStore
DataStoreResources.model_host,
_dataStoreAttributes.getAttribute(DataStoreAttributes.A_HOST_NAME),
_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)
@ -3841,8 +3842,8 @@ public final class DataStore
{
}
trace("-----------------------------------------");
trace("Start Tracing at " + System.currentTimeMillis());
trace("-----------------------------------------"); //$NON-NLS-1$
trace("Start Tracing at " + System.currentTimeMillis()); //$NON-NLS-1$
}
}
@ -3858,8 +3859,8 @@ public final class DataStore
{
}
memLog("-----------------------------------------");
memLog("Start Memory Logging at " + System.currentTimeMillis());
memLog("-----------------------------------------"); //$NON-NLS-1$
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++)
{
_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)
{
@ -3906,7 +3907,7 @@ public final class DataStore
try
{
_traceFile.writeBytes(message);
_traceFile.writeBytes(System.getProperty("line.separator"));
_traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
}
catch (IOException e)
{
@ -3920,9 +3921,9 @@ public final class DataStore
{
try
{
_memLogFile.writeBytes((new Date()).toString() + ": ");
_memLogFile.writeBytes((new Date()).toString() + ": "); //$NON-NLS-1$
_memLogFile.writeBytes(message);
_memLogFile.writeBytes(System.getProperty("line.separator"));
_memLogFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
}
catch (IOException e)
{
@ -3940,8 +3941,8 @@ public final class DataStore
{
try
{
_traceFile.writeBytes("Finished Tracing");
_traceFile.writeBytes(System.getProperty("line.separator"));
_traceFile.writeBytes("Finished Tracing"); //$NON-NLS-1$
_traceFile.writeBytes(System.getProperty("line.separator")); //$NON-NLS-1$
_traceFile.close();
}
catch (IOException e)
@ -4032,8 +4033,8 @@ public final class DataStore
catch (IOException e)
{
// the jar must be corrupted, so we must erase it.
System.out.println("Cache jarfile corrupted... erasing it.");
if (!_cacheJar.delete()) System.out.println("Couldn't erase corrupted jarfile!");
System.out.println("Cache jarfile corrupted... erasing it."); //$NON-NLS-1$
if (!_cacheJar.delete()) System.out.println("Couldn't erase corrupted jarfile!"); //$NON-NLS-1$
// try to make a new one again.
assignCacheJar();
return;
@ -4041,7 +4042,7 @@ public final class DataStore
oldEntries = oldJarFile.entries();
// 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;
try
@ -4050,7 +4051,7 @@ public final class DataStore
}
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;
}
@ -4086,14 +4087,14 @@ public final class DataStore
}
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) { }
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
JarEntry newEntry = new JarEntry(className.replace('.', '/') + ".class");
JarEntry newEntry = new JarEntry(className.replace('.', '/') + ".class"); //$NON-NLS-1$
newEntry.setCompressedSize(-1);
try
@ -4105,17 +4106,17 @@ public final class DataStore
}
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) { }
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
try { oldJarFile.close(); } catch (IOException ee) { }
if (!_cacheJar.delete()) System.out.println("Could not delete old cache jar.");
if (!newJarFile.renameTo(_cacheJar)) System.out.println("Could not rename new 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."); //$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
@ -4131,14 +4132,14 @@ public final class DataStore
{
String cacheDirectory = getCacheDirectory();
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 (!cacheJar.exists())
{
try
{
JarOutputStream cacheOut = createNewCacheJar(cacheJar);
cacheOut.putNextEntry(new JarEntry("/"));
cacheOut.putNextEntry(new JarEntry("/")); //$NON-NLS-1$
cacheOut.closeEntry();
cacheOut.close();
}

View file

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

View file

@ -42,26 +42,26 @@ public class DataStoreSchema
private DataElement _abstractRelationDescriptor;
public static final String C_VALIDATE_TICKET = "C_VALIDATE_TICKET";
public static final String C_SET = "C_SET";
public static final String C_MODIFY = "C_MODIFY";
public static final String C_SET_HOST = "C_SET_HOST";
public static final String C_SCHEMA = "C_SCHEMA";
public static final String C_SET_PREFERENCE = "C_SET_PREFERENCE";
public static final String C_ADD_MINERS = "C_ADD_MINERS";
public static final String C_ACTIVATE_MINER = "C_ACTIVATE_MINER";
public static final String C_INIT_MINERS = "C_INIT_MINERS";
public static final String C_OPEN = "C_OPEN";
public static final String C_CANCEL = "C_CANCEL";
public static final String C_SEND_INPUT = "C_SEND_INPUT";
public static final String C_QUERY = "C_QUERY";
public static final String C_REFRESH = "C_REFRESH";
public static final String C_EXIT = "C_EXIT";
public static final String C_CLOSE = "C_CLOSE";
public static final String C_NOTIFICATION = "C_NOTIFICATION";
public static final String C_QUERY_INSTALL = "C_QUERY_INSTALL";
public static final String C_QUERY_CLIENT_IP = "C_QUERY_CLIENT_IP";
public static final String C_QUERY_JVM = "C_QUERY_JVM";
public static final String C_VALIDATE_TICKET = "C_VALIDATE_TICKET"; //$NON-NLS-1$
public static final String C_SET = "C_SET"; //$NON-NLS-1$
public static final String C_MODIFY = "C_MODIFY"; //$NON-NLS-1$
public static final String C_SET_HOST = "C_SET_HOST"; //$NON-NLS-1$
public static final String C_SCHEMA = "C_SCHEMA"; //$NON-NLS-1$
public static final String C_SET_PREFERENCE = "C_SET_PREFERENCE"; //$NON-NLS-1$
public static final String C_ADD_MINERS = "C_ADD_MINERS"; //$NON-NLS-1$
public static final String C_ACTIVATE_MINER = "C_ACTIVATE_MINER"; //$NON-NLS-1$
public static final String C_INIT_MINERS = "C_INIT_MINERS"; //$NON-NLS-1$
public static final String C_OPEN = "C_OPEN"; //$NON-NLS-1$
public static final String C_CANCEL = "C_CANCEL"; //$NON-NLS-1$
public static final String C_SEND_INPUT = "C_SEND_INPUT"; //$NON-NLS-1$
public static final String C_QUERY = "C_QUERY"; //$NON-NLS-1$
public static final String C_REFRESH = "C_REFRESH"; //$NON-NLS-1$
public static final String C_EXIT = "C_EXIT"; //$NON-NLS-1$
public static final String C_CLOSE = "C_CLOSE"; //$NON-NLS-1$
public static final String C_NOTIFICATION = "C_NOTIFICATION"; //$NON-NLS-1$
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"; //$NON-NLS-1$
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);
parentD.setDepth(1);
_attributes = _dataStore.createRelationDescriptor(schemaRoot, "attributes");
_attributes = _dataStore.createRelationDescriptor(schemaRoot, "attributes"); //$NON-NLS-1$
_attributes.setDepth(0);
DataElement argsD = _dataStore.createRelationDescriptor(schemaRoot, DataStoreResources.model_arguments);
@ -271,7 +271,7 @@ public class DataStoreSchema
//Base 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);
// file objects
@ -312,23 +312,23 @@ public class DataStoreSchema
// basic commands
_dataStore.createCommandDescriptor(cancellable, DataStoreResources.model_Cancel, "*", C_CANCEL);
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set, "-", C_SET, false);
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set_Host, "-", C_SET_HOST, false);
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Init_Miners, "*", C_INIT_MINERS, false);
_dataStore.createCommandDescriptor(rootD, "Add Miners", "-", C_ADD_MINERS, false);
_dataStore.createCommandDescriptor(rootD, "Activate Miner", "-", C_ACTIVATE_MINER, false);
_dataStore.createCommandDescriptor(rootD, "Set Preference", "-", C_SET_PREFERENCE, false);
_dataStore.createCommandDescriptor(cancellable, DataStoreResources.model_Cancel, "*", C_CANCEL); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Set, "-", C_SET, false); //$NON-NLS-1$
_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); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, "Add Miners", "-", C_ADD_MINERS, false); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.createCommandDescriptor(rootD, "Activate Miner", "-", C_ACTIVATE_MINER, false); //$NON-NLS-1$ //$NON-NLS-2$
_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_Get_Schema, "*", C_SCHEMA, false);
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Exit, "*", C_EXIT, false);
_dataStore.createCommandDescriptor(rootD, "Query Install", "*", C_QUERY_INSTALL, false);
_dataStore.createCommandDescriptor(rootD, "Query Client IP", "*", C_QUERY_CLIENT_IP, false);
_dataStore.createCommandDescriptor(rootD, "Query JVM", "*", C_QUERY_JVM, 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); //$NON-NLS-1$
_dataStore.createCommandDescriptor(rootD, DataStoreResources.model_Exit, "*", C_EXIT, false); //$NON-NLS-1$
_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); //$NON-NLS-1$ //$NON-NLS-2$
_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, "Send Input", "*", C_SEND_INPUT, false);
_dataStore.createCommandDescriptor(rootD, "Notification", "*", C_NOTIFICATION, false); //$NON-NLS-1$ //$NON-NLS-2$
_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

View file

@ -28,7 +28,7 @@ import java.io.UnsupportedEncodingException;
public class DefaultByteConverter implements IByteConverter
{
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)
{
}

View file

@ -18,15 +18,15 @@ package org.eclipse.dstore.core.model;
public interface IDataStoreConstants
{
public static final String PASSWORD_EXPIRED = "password expired";
public static final String NEW_PASSWORD_INVALID = "new password not valid";
public static final String AUTHENTICATION_FAILED = "Authentification Failed";
public static final String CONNECTED = "connected";
public static final String UNKNOWN_PROBLEM = "unknown problem connecting to server";
public static final String SERVER_FAILURE = "server failure: ";
public static final String ATTEMPT_RECONNECT = "attempt reconnect";
public static final String PORT_OUT_RANGE = "specified port out of range:";
public static final String PASSWORD_EXPIRED = "password expired"; //$NON-NLS-1$
public static final String NEW_PASSWORD_INVALID = "new password not valid"; //$NON-NLS-1$
public static final String AUTHENTICATION_FAILED = "Authentification Failed"; //$NON-NLS-1$
public static final String CONNECTED = "connected"; //$NON-NLS-1$
public static final String UNKNOWN_PROBLEM = "unknown problem connecting to server"; //$NON-NLS-1$
public static final String SERVER_FAILURE = "server failure: "; //$NON-NLS-1$
public static final String ATTEMPT_RECONNECT = "attempt reconnect"; //$NON-NLS-1$
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 C_START_SPIRIT = "C_START_SPIRIT";
public static final String DATASTORE_SPIRIT_DESCRIPTOR = "datastore.spirit"; //$NON-NLS-1$
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()
{
setName("DStore UpdateHandler"+getName());
setName("DStore UpdateHandler"+getName()); //$NON-NLS-1$
_dataObjects = new ArrayList();
_classesToSend = new ArrayList();
}

View file

@ -174,7 +174,7 @@ public class ConnectionEstablisher
if (session == null)
{
System.out.println("handshake failed");
System.out.println("handshake failed"); //$NON-NLS-1$
sslSocket.close();
return;
}
@ -208,7 +208,7 @@ public class ConnectionEstablisher
catch (IOException ioe)
{
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;
}
}
@ -240,7 +240,7 @@ public class ConnectionEstablisher
}
// 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)
{
int lPort = 0;
@ -259,7 +259,7 @@ public class ConnectionEstablisher
// create server socket from port
try
{
if (_dataStore.usingSSL())
if (_dataStore.usingSSL() && sslContext != null)
{
try
{
@ -291,7 +291,7 @@ public class ConnectionEstablisher
// create server socket from port
if (_dataStore.usingSSL())
if (_dataStore.usingSSL() && sslContext != null)
{
try
{
@ -330,17 +330,17 @@ public class ConnectionEstablisher
ArrayList loaders = new ArrayList();
loaders.add(new ExternalLoader(getClass().getClassLoader(), "*"));
loaders.add(new ExternalLoader(getClass().getClassLoader(), "*")); //$NON-NLS-1$
_commandHandler = new ServerCommandHandler(loaders);
_updateHandler = new ServerUpdateHandler();
String pluginPath = System.getProperty("A_PLUGIN_PATH");
ISSLProperties sslProperties = new ServerSSLProperties();
_dataStore = new DataStore(_serverAttributes, _commandHandler, _updateHandler, null);
_dataStore.setSSLProperties(sslProperties);
DataElement ticket = _dataStore.getTicket();
System.out.println("ticket="+ticketStr); //$NON-NLS-1$
ticket.setAttribute(DE.A_NAME, ticketStr);
_updateHandler.setDataStore(_dataStore);
@ -379,7 +379,7 @@ public class ConnectionEstablisher
System.err.println(_serverSocket.getLocalPort());
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)
{

View file

@ -76,7 +76,7 @@ public class MinerLoader implements ISchemaRegistry
String pluginDir = _dataStore.getAttribute(DataStoreAttributes.A_PLUGIN_PATH);
// default location
String defaultMinerFile = pluginDir + File.separator + "minerFile.dat";
String defaultMinerFile = pluginDir + File.separator + "minerFile.dat"; //$NON-NLS-1$
File defaultMF = new File(defaultMinerFile);
if (defaultMF.exists())
{
@ -86,7 +86,7 @@ public class MinerLoader implements ISchemaRegistry
}
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
{
@ -106,13 +106,13 @@ public class MinerLoader implements ISchemaRegistry
{
String minersDir = (String) minerLocations.get(i);
String minerFile = null;
if (minersDir.endsWith(".dat"))
if (minersDir.endsWith(".dat")) //$NON-NLS-1$
{
minerFile = pluginDir + File.separator + minersDir;
}
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);
if (!_minerFileList.contains(minerFile))
@ -123,7 +123,7 @@ public class MinerLoader implements ISchemaRegistry
}
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
{
loadMiners(minerFile, null);
@ -166,7 +166,7 @@ public class MinerLoader implements ISchemaRegistry
// check name
name = name.trim();
if (!name.startsWith("#") && (name.length() > 5))
if (!name.startsWith("#") && (name.length() > 5)) //$NON-NLS-1$
{
Miner miner = loadMiner(name);
if (miner != null)
@ -254,7 +254,7 @@ public class MinerLoader implements ISchemaRegistry
unconnectedMiners.remove(miner);
if (connectMiner(miner))
{
_dataStore.trace("connected " + miner.getMinerName());
_dataStore.trace("connected " + miner.getMinerName()); //$NON-NLS-1$
}
else
{
@ -317,7 +317,7 @@ public class MinerLoader implements ISchemaRegistry
{
if (_externalRemoteLoader == null)
{
_externalRemoteLoader = new ExternalLoader(getRemoteLoader(), "*");
_externalRemoteLoader = new ExternalLoader(getRemoteLoader(), "*"); //$NON-NLS-1$
}
return _externalRemoteLoader;
}

View file

@ -40,9 +40,9 @@ public class Server
//Tell the Launcher that we are starting
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
{
String[] vers = new String[3];

View file

@ -38,7 +38,7 @@ public class ServerAttributes extends DataStoreAttributes
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.length() > 0))
{
@ -56,13 +56,13 @@ public class ServerAttributes extends DataStoreAttributes
}
else
{
setAttribute(A_PLUGIN_PATH, "/home/");
setAttribute(A_PLUGIN_PATH, "/home/"); //$NON-NLS-1$
}
setAttribute(A_LOCAL_NAME, InetAddress.getLocalHost().getHostName());
setAttribute(A_HOST_NAME, "server_host");
setAttribute(A_HOST_PATH, "/home/");
setAttribute(A_HOST_NAME, "server_host"); //$NON-NLS-1$
setAttribute(A_HOST_PATH, "/home/"); //$NON-NLS-1$
}
catch (UnknownHostException e)
{

View file

@ -213,7 +213,7 @@ public class ServerCommandHandler extends CommandHandler
DataElement host = _dataStore.getHostRoot();
_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.update(host);
@ -312,9 +312,9 @@ public class ServerCommandHandler extends CommandHandler
{
DataElement element = (DataElement)lastCreated.get(i);
statsBuffer.append(element.getName());
statsBuffer.append(":");
statsBuffer.append("id="+element.getId());
statsBuffer.append(";");
statsBuffer.append(":"); //$NON-NLS-1$
statsBuffer.append("id="+element.getId()); //$NON-NLS-1$
statsBuffer.append(";"); //$NON-NLS-1$
}
@ -346,7 +346,7 @@ public class ServerCommandHandler extends CommandHandler
{
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())
{
@ -404,7 +404,7 @@ public class ServerCommandHandler extends CommandHandler
*/
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)
{
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)
{
sendClass(className, "default");
sendClass(className, "default"); //$NON-NLS-1$
}
/**

View file

@ -303,6 +303,7 @@ public class ServerLauncher extends Thread {
{
"java", //$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$
_port,
timeout,
@ -415,12 +416,14 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-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$
}
}
/**
@ -435,11 +438,13 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$
System.exit(-1);
}
else
{
_path = pluginPath.trim();
_path = pluginPath.trim();
_connections = new ArrayList();
init(portStr);
_connections = new ArrayList();
init(portStr);
}
}
/**
@ -456,12 +461,14 @@ public class ServerLauncher extends Thread {
System.out.println("A_PLUGIN_PATH is not defined"); //$NON-NLS-1$
System.exit(-1);
}
else
{
_path = pluginPath.trim();
_path = pluginPath.trim();
_serverPortRange = serverPortRange;
_connections = new ArrayList();
init(portStr);
_serverPortRange = serverPortRange;
_connections = new ArrayList();
init(portStr);
}
}
private String getKeyStoreLocation() {
@ -522,14 +529,14 @@ public class ServerLauncher extends Thread {
}
} catch (UnknownHostException e) {
System.err
.println("Networking problem, can't resolve local host");
.println("Networking problem, can't resolve local host"); //$NON-NLS-1$
e.printStackTrace();
System.exit(-1);
} catch (BindException e) {
System.err.println("socket taken on " + i); //$NON-NLS-1$
// keep going
} catch (IOException e) {
System.err.println("Failure to create ServerSocket");
System.err.println("Failure to create ServerSocket"); //$NON-NLS-1$
e.printStackTrace();
System.exit(-1);
}
@ -560,11 +567,11 @@ public class ServerLauncher extends Thread {
+ port);
} catch (UnknownHostException e) {
System.err
.println("Networking problem, can't resolve local host");
.println("Networking problem, can't resolve local host"); //$NON-NLS-1$
e.printStackTrace();
System.exit(-1);
} catch (IOException e) {
System.err.println("Failure to create ServerSocket");
System.err.println("Failure to create ServerSocket"); //$NON-NLS-1$
e.printStackTrace();
System.exit(-1);
}
@ -625,7 +632,7 @@ public class ServerLauncher extends Thread {
_connections.add(listener);
}
} 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);
}
}

View file

@ -59,7 +59,7 @@ public class ServerReceiver extends Receiver
DataElement log = _dataStore.getLogRoot();
log.addNestedData(rootOutput, false);
if (rootOutput.getName().equals("C_EXIT"))
if (rootOutput.getName().equals("C_EXIT")) //$NON-NLS-1$
{
finish();
@ -82,7 +82,7 @@ public class ServerReceiver extends Receiver
*/
public void handleError(Throwable e)
{
System.out.println("RECEIVER ERROR");
System.out.println("RECEIVER ERROR"); //$NON-NLS-1$
// e.printStackTrace();
System.out.println(e);
_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_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_BIND_ERROR = "Error binding socket";
public static final String RC_GENERAL_IO_ERROR = "General IO error creating socket";
public static final String RC_CONNECTION_ERROR = "Connection 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"; //$NON-NLS-1$
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"; //$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 static final String ENABLE_SSL = "enable_ssl";
private static final String DISABLE_SERVER_SSL = "disable_server_ssl";
private static final String ENABLE_SSL = "enable_ssl"; //$NON-NLS-1$
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_PASSWORD = "daemon_keystore_password";
private static final String DAEMON_KEYSTORE_FILE = "daemon_keystore_file"; //$NON-NLS-1$
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_PASSWORD = "server_keystore_password";
private static final String SERVER_KEYSTORE_FILE = "server_keystore_file"; //$NON-NLS-1$
private static final String SERVER_KEYSTORE_PASSWORD = "server_keystore_password"; //$NON-NLS-1$
public ServerSSLProperties()
{
try
{
ResourceBundle properties = ResourceBundle.getBundle("ssl");
_enableSSL = properties.getString(ENABLE_SSL).trim().equals("true");
ResourceBundle properties = ResourceBundle.getBundle("ssl"); //$NON-NLS-1$
_enableSSL = properties.getString(ENABLE_SSL).trim().equals("true"); //$NON-NLS-1$
if (_enableSSL)
{
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)
{
@ -96,13 +96,13 @@ public class ServerSSLProperties implements ISSLProperties
if (_enableSSL)
{
System.out.println("SSL Settings");
System.out.println("[daemon keystore:\t"+_daemonKeyStorePath+"]");
System.out.println("[daemon keystore pw:\t"+_daemonKeyStorePassword+"]");
System.out.println("SSL Settings"); //$NON-NLS-1$
System.out.println("[daemon keystore:\t"+_daemonKeyStorePath+"]"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println("[daemon keystore pw:\t"+_daemonKeyStorePassword+"]"); //$NON-NLS-1$ //$NON-NLS-2$
if (!_disableServerSSL)
{
System.out.println("[server keystore:\t"+_serverKeyStorePath+"]");
System.out.println("[server keystore pw:\t"+_serverKeyStorePassword+"]");
System.out.println("[server keystore:\t"+_serverKeyStorePath+"]"); //$NON-NLS-1$ //$NON-NLS-2$
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 = {
DataStoreResources.KEEPALIVE_TYPE,
"server.keepalive.root.id",
"server.keepalive",
"doc",
"",
"",
"server.keepalive.root.id", //$NON-NLS-1$
"server.keepalive", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _confirmKeepAliveAttributes = {
DataStoreResources.KEEPALIVECONFIRM_TYPE,
"server.keepalive.confirm.root.id",
"server.confirmkeepalive",
"doc",
"",
"",
"server.keepalive.confirm.root.id", //$NON-NLS-1$
"server.confirmkeepalive", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _docAttributes = {
DataStoreResources.DOCUMENT_TYPE,
"server.doc.root.id",
"server.document",
"doc",
"",
"",
"server.doc.root.id", //$NON-NLS-1$
"server.document", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _fileAttributes = {
DataStoreResources.FILE_TYPE,
"server.file.root.id",
"server.file",
"doc",
"",
"",
"server.file.root.id", //$NON-NLS-1$
"server.file", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _classAttributes = {
DataStoreResources.CLASS_TYPE,
"server.class.root.id",
"server.class",
"doc",
"",
"",
"server.class.root.id", //$NON-NLS-1$
"server.class", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _requestClassAttributes = {
DataStoreResources.REQUEST_CLASS_TYPE,
"server.requestclass.root.id",
"server.requestclass",
"doc",
"",
"",
"server.requestclass.root.id", //$NON-NLS-1$
"server.requestclass", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
private static String[] _serializeAttributes = {
DataStoreResources.SERIALIZED_TYPE,
"server.serialized.root.id",
"server.serialized",
"doc",
"",
"",
"server.serialized.root.id", //$NON-NLS-1$
"server.serialized", //$NON-NLS-1$
"doc", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
DataStoreResources.FALSE,
"2"};
"2"}; //$NON-NLS-1$
protected DataElement _fileDocumentElement;
protected DataElement _docDocumentElement;
@ -276,7 +276,7 @@ public class ServerUpdateHandler extends UpdateHandler
document.setUpdated(true);
document.setParent(null);
DataElement response = _commandGenerator.generateResponse(document, _dataObjects);
_commandGenerator.generateResponse(document, _dataObjects);
for (int j = 0; j < _senders.size(); j++)
{
@ -337,7 +337,7 @@ public class ServerUpdateHandler extends UpdateHandler
if (sender.socket() == socket)
{
// 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);
removeSender(sender);
}
@ -427,15 +427,15 @@ public class ServerUpdateHandler extends UpdateHandler
*/
public synchronized void sendClass(String className)
{
sendClass(className, "default");
sendClass(className, "default"); //$NON-NLS-1$
}
public void sendKeepAliveRequest()
{
DataElement document = _keepAliveDocumentElement;
document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "request");
document.setAttribute(DE.A_VALUE, "request");
document.setAttribute(DE.A_NAME, "request"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "request"); //$NON-NLS-1$
document.setParent(null);
_pendingKeepAliveRequest = document;
notifyInput();
@ -445,8 +445,8 @@ public class ServerUpdateHandler extends UpdateHandler
{
DataElement document = _confirmKeepAliveDocumentElement;
document.setPendingTransfer(true);
document.setAttribute(DE.A_NAME, "confirm");
document.setAttribute(DE.A_VALUE, "confirm");
document.setAttribute(DE.A_NAME, "confirm"); //$NON-NLS-1$
document.setAttribute(DE.A_VALUE, "confirm"); //$NON-NLS-1$
document.setParent(null);
_pendingKeepAliveConfirmation = document;
notifyInput();

View file

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

View file

@ -39,8 +39,8 @@ public class DataElementRemover extends Handler
public static final int DEFAULT_INTERVAL_TIME = 60; // in seconds
private int _intervalTime = DEFAULT_INTERVAL_TIME * 1000;
private int _expiryTime = DEFAULT_EXPIRY_TIME * 1000;
public static final String EXPIRY_TIME_PROPERTY_NAME = "SPIRIT_EXPIRY_TIME";
public static final String INTERVAL_TIME_PROPERTY_NAME = "SPIRIT_INTERVAL_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"; //$NON-NLS-1$
public DataElementRemover(DataStore dataStore)
{
@ -50,7 +50,7 @@ public class DataElementRemover extends Handler
getTimes();
setWaitTime(_intervalTime);
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());
}
@ -59,21 +59,21 @@ public class DataElementRemover extends Handler
try
{
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)
{
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;
}
try
{
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)
{
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;
}
}
@ -114,25 +114,25 @@ public class DataElementRemover extends Handler
{
synchronized (_queue)
{
_dataStore.memLog(" ");
_dataStore.memLog(" "); //$NON-NLS-1$
int disconnected = 0;
if (!_dataStore.isDoSpirit())
{
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();
}
_dataStore.memLog("Total heap size: " + Runtime.getRuntime().totalMemory());
_dataStore.memLog("Elements created so far: " + numCreated);
_dataStore.memLog("Elements disconnected so far: " + numDisconnected);
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved);
_dataStore.memLog("DataElements GCed so far: " + numGCed);
_dataStore.memLog("Total heap size: " + Runtime.getRuntime().totalMemory()); //$NON-NLS-1$
_dataStore.memLog("Elements created so far: " + numCreated); //$NON-NLS-1$
_dataStore.memLog("Elements disconnected so far: " + numDisconnected); //$NON-NLS-1$
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); //$NON-NLS-1$
_dataStore.memLog("DataElements GCed so far: " + numGCed); //$NON-NLS-1$
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)
{
@ -150,11 +150,11 @@ public class DataElementRemover extends Handler
}
_dataStore.getHashMap().remove(toBeDisconnected.getId());
}
_dataStore.memLog("Disconnected " + disconnected + " DataElements.");
_dataStore.memLog("Elements created so far: " + numCreated);
_dataStore.memLog("Elements disconnected so far: " + numDisconnected);
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved);
_dataStore.memLog("DataElements GCed so far: " + numGCed);
_dataStore.memLog("Disconnected " + disconnected + " DataElements."); //$NON-NLS-1$ //$NON-NLS-2$
_dataStore.memLog("Elements created so far: " + numCreated); //$NON-NLS-1$
_dataStore.memLog("Elements disconnected so far: " + numDisconnected); //$NON-NLS-1$
_dataStore.memLog("Spirit elements cleaned so far: " + numRemoved); //$NON-NLS-1$
_dataStore.memLog("DataElements GCed so far: " + numGCed); //$NON-NLS-1$
}
}

View file

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

View file

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

View file

@ -170,7 +170,7 @@ public class Sender implements ISender
InputStream classInStream = null;
className = className.replace('.', '/');
className = className + ".class";
className = className + ".class"; //$NON-NLS-1$
URL classLocation = null;
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.
BufferedInputStream bufInputStream = new BufferedInputStream(classInStream);
if (bufInputStream == null)
{
generateEmptyClass(classElement);
return; // throw new IOException("BufferedInputStream could not be instantiated on " + className);
}
try
{
int classSize = bufInputStream.available();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -49,21 +49,23 @@ public class PropertySource implements IPropertySource
_descriptors = new IPropertyDescriptor[attributesSize + 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$
for (int i = 0; i < attributesSize; i++)
{
IDataElement attribute = (IDataElement)attributes.get(i);
List types = attribute.getAssociated("attributes"); //$NON-NLS-1$
String type = null;
if (types.size() > 0)
type = ((IDataElement)types.get(0)).getName();
else
type = "String"; //$NON-NLS-1$
_properties.put(attribute.getName(), type);
_descriptors[i+2] = new TextPropertyDescriptor(attribute.getName(), attribute.getName());
}
if (attributes != null)
{
for (int i = 0; i < attributesSize; i++)
{
IDataElement attribute = (IDataElement)attributes.get(i);
List types = attribute.getAssociated("attributes"); //$NON-NLS-1$
String type = null;
if (types.size() > 0)
type = ((IDataElement)types.get(0)).getName();
else
type = "String"; //$NON-NLS-1$
_properties.put(attribute.getName(), type);
_descriptors[i+2] = new TextPropertyDescriptor(attribute.getName(), attribute.getName());
}
}
}