Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'rse/plugins/org.eclipse.rse.services.dstore/src')
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java179
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java275
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java321
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/Activator.java59
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/IDStoreService.java22
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.java42
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.properties31
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java1232
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java362
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreVirtualHostFile.java78
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java519
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java381
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/rmtservice/DStoreRemoteServiceService.java43
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchResultConfiguration.java51
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java145
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostOutput.java44
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java74
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java204
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java122
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java402
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java327
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java47
-rw-r--r--rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java326
23 files changed, 0 insertions, 5286 deletions
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java
deleted file mode 100644
index 2482edc11..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellOutputReader.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.internal.services.dstore.shell;
-
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.extra.internal.extra.DomainEvent;
-import org.eclipse.dstore.extra.internal.extra.IDomainListener;
-import org.eclipse.rse.services.dstore.shells.DStoreHostOutput;
-import org.eclipse.rse.services.shells.AbstractHostShellOutputReader;
-import org.eclipse.rse.services.shells.IHostOutput;
-import org.eclipse.rse.services.shells.IHostShell;
-import org.eclipse.rse.services.shells.IHostShellOutputReader;
-import org.eclipse.rse.services.shells.SimpleHostOutput;
-
-public class DStoreShellOutputReader extends AbstractHostShellOutputReader implements IHostShellOutputReader, IDomainListener
-{
- protected DataElement _status;
- protected int _statusOffset = 0;
-
- public DStoreShellOutputReader(IHostShell hostShell, DataElement status, boolean isErrorReader)
- {
- super(hostShell, isErrorReader);
- setName("DStoreShellOutputReader"+getName()); //$NON-NLS-1$
- _status = status;
- if (status != null)
- {
- _status.getDataStore().getDomainNotifier().addDomainListener(this);
- }
- }
-
- public String getWorkingDirectory()
- {
- String pwd = _status.getSource();
- return pwd;
- }
-
- protected IHostOutput internalReadLine()
- {
- if (_status != null && _keepRunning)
- {
- int newSize = _status.getNestedSize();
-
- while (newSize > _statusOffset)
- {
- DataElement line = _status.get(_statusOffset++);
-
-
-
- String type = line.getType();
- boolean isError = type.equals("error") || type.equals("stderr"); //$NON-NLS-1$ //$NON-NLS-2$
- if (_isErrorReader && isError)
- {
- return new DStoreHostOutput(line);
- }
- else if (!_isErrorReader && !isError)
- {
- return new DStoreHostOutput(line);
- }
- }
-
-
- try
- {
- waitForResponse();
- return internalReadLine();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- if (_status.getValue().equals("done")) //$NON-NLS-1$
- {
- if (!_isErrorReader)
- {
- DataElement dummyLine = _status.getDataStore().createObject(_status, "stdout", ""); //$NON-NLS-1$ //$NON-NLS-2$
- return new DStoreHostOutput(dummyLine);
- }
- else
- {
- return null;
- }
- }
- return new SimpleHostOutput(""); //$NON-NLS-1$
- }
-
- public boolean listeningTo(DomainEvent e)
- {
- return e.getParent() == _status;
- }
-
- public void domainChanged(DomainEvent event)
- {
- if (_status.getValue().equals("done")) //$NON-NLS-1$
- {
-
- if (_status == event.getParent())
- {
- finish();
- }
- }
- else
- {
- // for now, this is pulled via internalReadLine()
- notifyResponse();
- }
-
- }
-
- /**
- * Causes the current thread to wait until this class request has been
- * fulfilled.
- */
- public synchronized void waitForResponse()
- {
- try
- {
- wait();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- }
-
- /**
- * Causes all threads waiting for this class request to be filled
- * to wake up.
- */
- public synchronized void notifyResponse()
- {
- try
- {
- notifyAll();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void finish()
- {
- super.finish();
- notifyResponse();
- }
-
- /*
- private void handleInput()
- {
- // append new results to existing results
- ArrayList results = _status.getNestedData();
- int totalSize = results.size();
- int currentSize = _linesOfOutput.size();
-
- for (int loop = currentSize; loop < totalSize; loop++)
- {
- DataElement result = (DataElement) results.get(loop);
- addLine(result.getName());
- }
- }
- */
-
-}
- \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java
deleted file mode 100644
index 6ec878adc..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/shell/DStoreShellThread.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.internal.services.dstore.shell;
-
-import java.io.File;
-
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.DataStoreSchema;
-import org.eclipse.rse.dstore.universal.miners.command.CommandMiner;
-import org.eclipse.rse.dstore.universal.miners.environment.EnvironmentMiner;
-
-
-
-public class DStoreShellThread
-{
- protected DataElement _runCmdDescriptor;
- protected DataElement _runShellDescriptor;
- protected DataElement _setEnvironmentDescriptor;
- protected DataElement _sendInputDescriptor;
- protected DataElement _cmdMinerElement;
- protected DataElement _envMinerElement;
-
- private String _encoding;
- private String _cwd;
- private String[] _envVars;
- private DataStore _dataStore;
- private DataElement _status;
- private String _invocation;
-
- /**
- * @param cwd initial working directory
- * @param invocation launch shell command
- * @param encoding
- * @param patterns patterns file for output interpretation
- * @param envVars user and system environment variables to launch shell with
- */
- public DStoreShellThread(DataStore dataStore, String cwd, String invocation, String encoding, String[] envVars)
- {
- super();
- _dataStore = dataStore;
- _encoding = encoding;
- _cwd = cwd;
- _envVars = envVars;
- _invocation = invocation;
- init();
- }
-
- protected void init()
- {
- // make this subsystem a communications listener
- DataElement contextDir = _dataStore.createObject(null, "directory", (new File(_cwd)).getName(), _cwd); //$NON-NLS-1$
- _dataStore.setObject(contextDir);
- setRemoteEnvironment(contextDir);
- if (_invocation== null || _invocation.equals(">")) //$NON-NLS-1$
- {
- sendShellToMiner(contextDir);
- }
- else
- {
- sendCommandToMiner(contextDir, _invocation);
-
- }
- }
-
- public DataElement getStatus()
- {
- return _status;
- }
-
- protected void sendShellToMiner(DataElement contextDir)
- {
- DataElement cmdD = getRunShellDescriptor(contextDir);
-
- if (cmdD != null)
- {
- String encoding = _encoding;
- if (encoding != null && encoding.length() > 0)
- {
- DataElement arg = _dataStore.createObject(null, "shell.encoding", encoding); //$NON-NLS-1$
- _status = _dataStore.command(cmdD, arg, contextDir);
- }
- else
- {
- _status = _dataStore.command(cmdD, contextDir);
- }
- }
- }
-
- protected void sendCommandToMiner(DataElement contextDir, String invocation)
- {
- DataElement cmdD = getRunCommandDescriptor(contextDir);
-
- if (cmdD != null)
- {
-
- if (invocation != null && invocation.length() > 0)
- {
- DataElement arg = _dataStore.createObject(null, "command", invocation); //$NON-NLS-1$
- _status = _dataStore.command(cmdD, arg, contextDir);
- }
- else
- {
- _status = _dataStore.command(cmdD, contextDir);
- }
- }
- }
- /**
- * Set the environment variables for this connection. For universal this sets them in the
- * DataStore tree. When a new shell is launched the environment variables are passed to the
- * shell.
- */
- public void setRemoteEnvironment(DataElement theObject)
- {
-
- if (_envVars != null && _envVars.length > 0)
- {
- DataElement theEnvironment = _dataStore.createObject(null, "Environment Variable", theObject.getName()); //$NON-NLS-1$
- for (int i = 0; i < _envVars.length; i++)
- {
- String var = _envVars[i];
- _dataStore.createObject(theEnvironment, "Environment Variable", var, var); //$NON-NLS-1$
- }
-
- theEnvironment.setAttribute(DE.A_NAME, theObject.getId());
- DataElement contObj = _dataStore.findObjectDescriptor("Container Object"); //$NON-NLS-1$
- DataElement setD = getSetEnvironmentDescriptor(contObj);
- if (setD != null)
- {
- _dataStore.command(setD, theEnvironment, theObject, false);
- }
- }
- }
-
-
- protected DataElement getRunCommandDescriptor(DataElement remoteObject)
- {
- if (_runCmdDescriptor == null || _dataStore != remoteObject.getDataStore())
- {
- _runCmdDescriptor = _dataStore.localDescriptorQuery(remoteObject.getDescriptor(), getRunCommandId());
- }
- return _runCmdDescriptor;
- }
-
- protected DataElement getRunShellDescriptor(DataElement remoteObject)
- {
- if (_runShellDescriptor == null || _dataStore != remoteObject.getDataStore())
- {
- _runShellDescriptor = _dataStore.localDescriptorQuery(remoteObject.getDescriptor(), getRunShellId(), 2);
- }
- return _runShellDescriptor;
- }
-
- protected DataElement getSetEnvironmentDescriptor(DataElement remoteObject)
- {
- if (_setEnvironmentDescriptor == null || _dataStore != remoteObject.getDataStore())
- {
- _setEnvironmentDescriptor = _dataStore.localDescriptorQuery(remoteObject.getDescriptor(), getSetEnvironmentId(), 2);
- }
- return _setEnvironmentDescriptor;
- }
-
-
- protected DataElement getSendInputDescriptor(DataElement remoteObject)
- {
- if (_sendInputDescriptor == null || _dataStore != remoteObject.getDataStore())
- {
- _sendInputDescriptor = _dataStore.findCommandDescriptor(DataStoreSchema.C_SEND_INPUT);
- }
-
- return _sendInputDescriptor;
- }
-
-
- protected DataElement getCmdSystemMinerElement()
- {
-
- if (_cmdMinerElement == null || _cmdMinerElement.getDataStore() != _dataStore)
- {
- _cmdMinerElement = _dataStore.findMinerInformation(getCmdSystemMinerId());
- }
- return _cmdMinerElement;
- }
-
- protected DataElement getEnvSystemMinerElement()
- {
-
- if (_envMinerElement == null || _envMinerElement.getDataStore() != _dataStore)
- {
- _envMinerElement = _dataStore.findMinerInformation(getEnvSystemMinerId());
-
- }
- return _envMinerElement;
- }
-
-
- protected String getCmdSystemMinerId()
- {
- return CommandMiner.MINER_ID;
- }
-
-
- protected String getEnvSystemMinerId()
- {
- return EnvironmentMiner.MINER_ID;
- }
-
- protected String getRunShellId()
- {
- return "C_SHELL"; //$NON-NLS-1$
- }
-
- protected String getRunCommandId()
- {
- return "C_COMMAND"; //$NON-NLS-1$
- }
-
- protected String getSetEnvironmentId()
- {
- return "C_SET_ENVIRONMENT_VARIABLES"; //$NON-NLS-1$
- }
-
-
- public void writeToShell(String command)
- {
- DataElement commandElement = _status.getParent();
- DataStore dataStore = commandElement.getDataStore();
-
- if (command.equals("") || command.equals("#break")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- String cmd = command;
- if (cmd.equals("")) //$NON-NLS-1$
- cmd = "#enter"; //$NON-NLS-1$
- DataElement commandDescriptor = getSendInputDescriptor(commandElement);
- if (commandDescriptor != null)
- {
- DataElement in = dataStore.createObject(null, "input", cmd); //$NON-NLS-1$
- dataStore.command(commandDescriptor, in, commandElement);
- }
- }
- else
- {
- String[] tokens = command.split("\n\r"); //$NON-NLS-1$
- for (int i = 0; i <tokens.length; i++)
- {
- String cmd = tokens[i];
-
- if (cmd != null)
- {
- DataElement commandDescriptor = getSendInputDescriptor(commandElement);
- if (commandDescriptor != null)
- {
- DataElement in = dataStore.createObject(null, "input", cmd); //$NON-NLS-1$
- dataStore.command(commandDescriptor, in, commandElement);
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java
deleted file mode 100644
index 09841fdf1..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
-
-public abstract class AbstractDStoreService implements IDStoreService
-{
- protected IDataStoreProvider _dataStoreProvider;
- protected ISystemMessageProvider _msgProvider;
- protected DataElement _minerElement;
- protected DStoreStatusMonitor _statusMonitor;
- protected Map _cmdDescriptorMap;
- protected DataElement _initializeStatus;
-
- public AbstractDStoreService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
- {
- _dataStoreProvider = dataStoreProvider;
- _msgProvider = msgProvider;
- _cmdDescriptorMap = new HashMap();
- }
-
- public DStoreStatusMonitor getStatusMonitor(DataStore dataStore)
- {
- if (_statusMonitor == null || _statusMonitor.getDataStore() != dataStore)
- {
- _statusMonitor = new DStoreStatusMonitor(dataStore);
- }
- return _statusMonitor;
- }
-
- public DataStore getDataStore()
- {
- return _dataStoreProvider.getDataStore();
- }
-
- protected DataElement getMinerElement()
- {
- if (_minerElement == null || _minerElement.getDataStore() != getDataStore())
- {
- _minerElement = getMinerElement(getMinerId());
- }
- return _minerElement;
- }
-
- protected DataElement getMinerElement(String id)
- {
- return getDataStore().findMinerInformation(id);
- }
-
- protected DataElement[] dsQueryCommand(IProgressMonitor monitor, DataElement subject, ArrayList args, String command)
- {
- // query roots
- DataElement queryCmd = getCommandDescriptor(subject, command);
-
- if (queryCmd != null)
- {
- DataElement status = getDataStore().command(queryCmd, args, subject, true);
- try
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- smon.waitForUpdate(status, monitor);
- int resultSize = subject.getNestedSize();
- if (resultSize == 0)
- {
- //System.out.println("status="+status);
- //System.out.println("subject="+subject);
- }
- checkHostJVM();
- // get results
- List nested = subject.getNestedData();
- if (nested != null)
- {
- return (DataElement[])nested.toArray(new DataElement[resultSize]);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- else
- {
- System.out.println("no query command for "+ subject); //$NON-NLS-1$
- }
- return new DataElement[0];
- }
-
- protected DataElement dsStatusCommand(IProgressMonitor monitor, DataElement subject, ArrayList args, String command)
- {
- // query roots
- DataElement queryCmd = getCommandDescriptor(subject, command);
-
- if (queryCmd != null)
- {
- DataElement status = getDataStore().command(queryCmd, args, subject, true);
- try
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- smon.waitForUpdate(status, monitor);
- }
- catch (Exception e)
- {
- }
- return status;
- }
- return null;
- }
-
- protected DataElement[] dsQueryCommand(IProgressMonitor monitor, DataElement subject, String command)
- {
- // query roots
- DataElement queryCmd = getCommandDescriptor(subject, command);
-
- if (queryCmd != null)
- {
- DataStore ds = getDataStore();
- DataElement status = ds.command(queryCmd, subject, true);
- try
- {
- getStatusMonitor(ds).waitForUpdate(status, monitor);
- checkHostJVM();
- // get results
- List nested = subject.getNestedData();
- if (nested != null)
- {
- return (DataElement[])nested.toArray(new DataElement[subject.getNestedSize()]);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- return new DataElement[0];
- }
-
- protected DataElement dsStatusCommand(IProgressMonitor monitor, DataElement subject, String command)
- {
- // query roots
- DataElement queryCmd = getCommandDescriptor(subject, command);
-
- if (queryCmd != null)
- {
- DataStore ds = getDataStore();
- DataElement status = ds.command(queryCmd, subject, true);
- try
- {
- getStatusMonitor(ds).waitForUpdate(status, monitor);
- }
- catch (Exception e)
- {
- }
- return status;
- }
- return null;
- }
-
- protected DataElement getCommandDescriptor(DataElement subject, String command)
- {
- DataStore ds = getDataStore();
- DataElement cmd = (DataElement)_cmdDescriptorMap.get(command);
- if (cmd == null || ds != cmd.getDataStore())
- {
- cmd = getDataStore().localDescriptorQuery(subject.getDescriptor(), command);
- _cmdDescriptorMap.put(command, cmd);
- }
- return cmd;
- }
-
- public int getServerVersion()
- {
- return getDataStore().getServerVersion();
- }
-
- public int getServerMinor()
- {
- return getDataStore().getServerMinor();
- }
-
- protected void checkHostJVM()
- {
- /*
- DataElement status = getDataStore().queryHostJVM();
- String source = status.getSource();
- String[] tokens = source.split(",");
-
- long freeMem = Long.parseLong(tokens[0]);
- long totalMem = Long.parseLong(tokens[1]);
-
- int numElements = Integer.parseInt(tokens[3]);
-
- System.out.println("Host JVM Stats:");
- System.out.println("\tfreeMem="+freeMem);
- System.out.println("\ttotalMem="+totalMem);
-
- System.out.println("\tnumber of elements="+numElements);
-
- String[] lastCreated = tokens[4].split(";");
- System.out.println("\tlast created:");
- for (int i = 0; i < lastCreated.length; i++)
- {
- System.out.println("\t\t" + lastCreated[i]);
- }
- */
- }
-
- public boolean isInitialized()
- {
- if (_initializeStatus != null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- return smon.determineStatusDone(_initializeStatus);
- }
- return false;
- }
-
- protected void waitForInitialize(IProgressMonitor monitor)
- {
- if (_initializeStatus != null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- try
- {
- smon.waitForUpdate(_initializeStatus, monitor, 100);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- getMinerElement();
- }
- }
-
- public void initService(IProgressMonitor monitor)
- {
- initMiner(monitor);
- }
-
- public void uninitService(IProgressMonitor monitor)
- {
- _initializeStatus = null;
- _cmdDescriptorMap.clear();
- _minerElement = null;
- _statusMonitor = null;
- }
-
- protected void initMiner(IProgressMonitor monitor)
- {
- DataElement fsElement = getMinerElement();
- if (fsElement == null)
- {
- if (getServerVersion() >= 8)
- {
- String minerId = getMinerId();
- String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$
- monitor.beginTask(message, IProgressMonitor.UNKNOWN);
- DataStore ds = getDataStore();
- if (_minerElement == null || _minerElement.getDataStore() != ds)
- {
- if (ds != null)
- {
- _initializeStatus = ds.activateMiner(minerId);
- /*
- DStoreStatusMonitor smon = getStatusMonitor(ds);
- try
- {
- smon.waitForUpdate(status, monitor, 50);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- getMinerElement();
- */
- }
- }
- }
- }
- monitor.done();
- }
-
- protected abstract String getMinerId();
-
- /**
- * For now just a dummy method
- * @param messageID
- * @return the message
- */
- public SystemMessage getMessage(String messageID)
- {
- return _msgProvider.getMessage(messageID);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/Activator.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/Activator.java
deleted file mode 100644
index 4a6b21603..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/Activator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class Activator extends Plugin {
-
- //The shared instance.
- private static Activator plugin;
-
- /**
- * The constructor.
- */
- public Activator() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/IDStoreService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/IDStoreService.java
deleted file mode 100644
index b40706d26..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/IDStoreService.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore;
-
-public interface IDStoreService
-{
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.java
deleted file mode 100644
index f8d231740..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ServiceResources extends NLS
-{
- private static String BUNDLE_NAME = "org.eclipse.rse.services.dstore.ServiceResources";//$NON-NLS-1$
-
- public static String DStore_Shell_Service_Label;
- public static String DStore_Search_Service_Label;
- public static String DStore_File_Service_Label;
- public static String DStore_Process_Service_Label;
-
- public static String DStore_Shell_Service_Description;
- public static String DStore_Search_Service_Description;
- public static String DStore_File_Service_Description;
- public static String DStore_Process_Service_Description;
-
- public static String DStore_Service_ProgMon_Initializing_Message;
- public static String DStore_Service_Percent_Complete_Message;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ServiceResources.class);
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.properties b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.properties
deleted file mode 100644
index 7f2a3e83d..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/ServiceResources.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-################################################################################
-# Copyright (c) 2006 IBM Corporation. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Initial Contributors:
-# The following IBM employees contributed to the Remote System Explorer
-# component that contains this file: David McKnight, Kushal Munir,
-# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
-# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
-#
-# Contributors:
-# {Name} (company) - description of contribution.
-################################################################################
-
-# NLS_MESSAGEFORMAT_VAR
-# NLS_ENCODING=UTF-8
-
-DStore_Shell_Service_Label=DStore Shell Service
-DStore_Search_Service_Label=DStore Search Service
-DStore_File_Service_Label=DStore File Service
-DStore_Process_Service_Label=DStore Process Service
-
-DStore_Service_ProgMon_Initializing_Message=Initializing &1...
-DStore_Service_Percent_Complete_Message=&0 of &1 complete (&2)
-
-DStore_Shell_Service_Description=The DStore Shell Service uses the RSE DataStore to provide service for the Shells subsystem. It requires a DataStore server or daemon to be running on the host machine.
-DStore_Search_Service_Description=The DStore Search Service uses the RSE DataStore to provide service for remote searches. It requires a DataStore server or daemon to be running on the host machine.
-DStore_File_Service_Description=The DStore File Service uses the RSE DataStore to provide service for the Files subsystem. It requires a DataStore server or daemon to be running on the host machine.
-DStore_Process_Service_Description=The DStore Process Service uses the RSE DataStore to provide service for the Processes subsystem. It requires a DataStore server or daemon to be running on the host machine. \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java
deleted file mode 100644
index 183cd73d6..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java
+++ /dev/null
@@ -1,1232 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.files;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.DataStoreAttributes;
-import org.eclipse.dstore.core.model.DataStoreResources;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
-import org.eclipse.rse.dstore.universal.miners.filesystem.UniversalByteStreamHandler;
-import org.eclipse.rse.dstore.universal.miners.filesystem.UniversalFileSystemMiner;
-import org.eclipse.rse.services.clientserver.IServiceConstants;
-import org.eclipse.rse.services.clientserver.ISystemFileTypes;
-import org.eclipse.rse.services.clientserver.PathUtility;
-import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.dstore.AbstractDStoreService;
-import org.eclipse.rse.services.dstore.ServiceResources;
-import org.eclipse.rse.services.dstore.util.DownloadListener;
-import org.eclipse.rse.services.dstore.util.FileSystemMessageUtil;
-import org.eclipse.rse.services.files.IFileService;
-import org.eclipse.rse.services.files.IHostFile;
-
-public class DStoreFileService extends AbstractDStoreService implements IFileService, IUniversalDataStoreConstants
-{
-
- protected org.eclipse.dstore.core.model.DataElement _uploadLogElement = null;
- protected Map _fileElementMap;
- private int _bufferUploadSize = IUniversalDataStoreConstants.BUFFER_SIZE;
- private int _bufferDownloadSize = IUniversalDataStoreConstants.BUFFER_SIZE;
- protected ISystemFileTypes _fileTypeRegistry;
-
- private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
- private static String[] _filterAttributes = {
- "attributes", //$NON-NLS-1$
- "filter", //$NON-NLS-1$
- "filter.id", //$NON-NLS-1$
- "doc", //$NON-NLS-1$
- "", //$NON-NLS-1$
- "", //$NON-NLS-1$
- DataStoreResources.FALSE,
- "2"}; //$NON-NLS-1$
-
- public DStoreFileService(IDataStoreProvider dataStoreProvider, ISystemFileTypes fileTypeRegistry, ISystemMessageProvider msgProvider)
- {
- super(dataStoreProvider, msgProvider);
- _fileElementMap = new HashMap();
- _fileTypeRegistry = fileTypeRegistry;
- }
-
- public void uninitService(IProgressMonitor monitor)
- {
- super.uninitService(monitor);
- _fileElementMap.clear();
- }
-
- public String getName()
- {
- return ServiceResources.DStore_File_Service_Label;
- }
-
- public String getDescription()
- {
- return ServiceResources.DStore_File_Service_Description;
- }
-
- public void setBufferUploadSize(int size)
- {
- _bufferUploadSize = size;
- }
-
- public void setBufferDownloadSize(int size)
- {
- _bufferDownloadSize = size;
- }
-
- protected int getBufferUploadSize()
- {
- return _bufferUploadSize;
- }
-
- protected int getBufferDownloadSize()
- {
- return _bufferDownloadSize;
- }
-
- protected String getMinerId()
- {
- return UniversalFileSystemMiner.MINER_ID;
- }
-
- protected String getByteStreamHandlerId()
- {
- return UniversalByteStreamHandler.class.getName();
- }
-
- protected String getDataStoreRoot()
- {
- return getDataStore().getAttribute(DataStoreAttributes.A_LOCAL_PATH);
- }
-
-
- protected String prepareForDownload(String localPath)
- {
- int index = localPath.lastIndexOf(File.separator);
- String parentDir = localPath.substring(0, index + 1);
-
- // change local root for datastore so that the file is downloaded
- // at the specified location
- setDataStoreRoot(parentDir);
-
- String dataStoreLocalPath = localPath.substring(index + 1);
-
- if (!dataStoreLocalPath.startsWith("/")) //$NON-NLS-1$
- dataStoreLocalPath = "/" + dataStoreLocalPath; //$NON-NLS-1$
-
- return dataStoreLocalPath;
- }
-
- protected void setDataStoreRoot(String root)
- {
- getDataStore().setAttribute(DataStoreAttributes.A_LOCAL_PATH, root);
- }
-
- protected DataElement findUploadLog()
- {
- DataElement minerInfo = getMinerElement();
- if (_uploadLogElement == null || _uploadLogElement.getDataStore() != getDataStore())
- {
- _uploadLogElement = getDataStore().find(minerInfo, DE.A_NAME, "universal.uploadlog", 2); //$NON-NLS-1$
- }
- return _uploadLogElement;
- }
-
- protected DataElement getAttributes(String fileNameFilter, boolean showHidden)
- {
- DataElement attributes = getDataStore().createTransientObject(_filterAttributes);
- String version = VERSION_1;
- StringBuffer buffer = new StringBuffer();
- String filter = ((fileNameFilter == null) ? "*" : fileNameFilter); //$NON-NLS-1$
- buffer.append(version).append(TOKEN_SEPARATOR).append(filter).append(TOKEN_SEPARATOR).append(showHidden);
- attributes.setAttribute(DE.A_SOURCE, buffer.toString());
- return attributes;
- }
-
-
-
- public boolean upload(IProgressMonitor monitor, InputStream inputStream, String remoteParent, String remoteFile,
- boolean isBinary, String hostEncoding)
- {
- BufferedInputStream bufInputStream = null;
-
-
- boolean isCancelled = false;
-
-
-
- try
- {
-
-// DataElement uploadLog = findUploadLog();
- findUploadLog();
-// listener = new FileTransferStatusListener(remotePath, shell, monitor, getConnectorService(), ds, uploadLog);
- // ds.getDomainNotifier().addDomainListener(listener);
-
- int buffer_size = getBufferUploadSize();
-
- // read in the file
- bufInputStream = new BufferedInputStream(inputStream, buffer_size);
-
- boolean first = true;
- byte[] buffer = new byte[buffer_size];
- byte[] convBytes;
- int numToRead = 0;
-
- int available = bufInputStream.available();
-
- long totalSent = 0;
-
- // upload bytes while available
- while (available > 0 && !isCancelled)
- {
-
-
- numToRead = (available < buffer_size) ? available : buffer_size;
-
- int bytesRead = bufInputStream.read(buffer, 0, numToRead);
-
- if (bytesRead == -1)
- break;
-
- totalSent += bytesRead;
-
- String byteStreamHandlerId = getByteStreamHandlerId();
- String remotePath = remoteParent + getSeparator(remoteParent) + remoteFile;
-
- if (!isBinary && hostEncoding != null)
- {
- String tempStr = new String(buffer, 0, bytesRead);
-
- // hack for zOS - \r causes problems for compilers
-// if (osName != null && (osName.startsWith("z") || osName.equalsIgnoreCase("aix")))
-// {
-// tempStr = tempStr.replace('\r', ' ');
-// }
-
- convBytes = tempStr.getBytes(hostEncoding);
-
- if (first)
- { // send first set of bytes
- first = false;
- getDataStore().replaceFile(remotePath, convBytes, convBytes.length, true, byteStreamHandlerId);
- }
- else
- { // append subsequent segments
- getDataStore().replaceAppendFile(remotePath, convBytes, convBytes.length, true, byteStreamHandlerId);
- }
- }
- else // binary
- {
- if (first)
- { // send first set of bytes
- first = false;
- getDataStore().replaceFile(remotePath, buffer, bytesRead, true, byteStreamHandlerId);
- }
- else
- { // append subsequent segments
- getDataStore().replaceAppendFile(remotePath, buffer, bytesRead, true, byteStreamHandlerId);
- }
- }
-
-
- if (monitor != null)
- {
-
- isCancelled = monitor.isCanceled();
-
- }
-
- available = bufInputStream.available();
- }
-// if (listener.uploadHasFailed())
-// {
-// showUploadFailedMessage(listener, source);
-// }
-// else
- {
- // transferSuccessful = true;
- }
- }
-
- catch (FileNotFoundException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (UnsupportedEncodingException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (IOException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (Exception e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- finally
- {
-
- try
- {
-
- if (bufInputStream != null)
- bufInputStream.close();
-
- if (isCancelled)
- {
- return false;
- //throw new RemoteFileCancelledException();
- }
- }
- catch (IOException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
-
- }
-
- return true;
- }
-
- public boolean upload(IProgressMonitor monitor, File file, String remoteParent, String remoteFile,
- boolean isBinary, String srcEncoding, String hostEncoding)
- {
- FileInputStream inputStream = null;
- BufferedInputStream bufInputStream = null;
-
-
- boolean isCancelled = false;
- boolean transferSuccessful = false;
-
- long totalBytes = file.length();
-
- try
- {
- // if the file is empty, create new empty file on host
- if (totalBytes == 0)
- {
- IHostFile created = createFile(monitor, remoteParent, remoteFile);
- return created.exists();
- }
-
- if (monitor != null)
- {
- monitor.setTaskName(file.getName());
- //subMonitor = new SubProgressMonitor(monitor, (int)totalBytes);
- }
-
-
-// DataElement uploadLog = findUploadLog();
- findUploadLog();
-// listener = new FileTransferStatusListener(remotePath, shell, monitor, getConnectorService(), ds, uploadLog);
- // ds.getDomainNotifier().addDomainListener(listener);
-
- int buffer_size = getBufferUploadSize();
-
- // read in the file
- inputStream = new FileInputStream(file);
- bufInputStream = new BufferedInputStream(inputStream, buffer_size);
-
- boolean first = true;
- byte[] buffer = new byte[buffer_size];
- byte[] convBytes;
- int numToRead = 0;
-
- int available = bufInputStream.available();
-
- long totalSent = 0;
-
- // upload bytes while available
- while (available > 0 && !isCancelled)
- {
-
- numToRead = (available < buffer_size) ? available : buffer_size;
-
- int bytesRead = bufInputStream.read(buffer, 0, numToRead);
-
- if (bytesRead == -1)
- break;
-
- totalSent += bytesRead;
-
- String byteStreamHandlerId = getByteStreamHandlerId();
- String remotePath = remoteParent + getSeparator(remoteParent) + remoteFile;
-
- if (!isBinary && srcEncoding != null && hostEncoding != null)
- {
- String tempStr = new String(buffer, 0, bytesRead, srcEncoding);
-
- // hack for zOS - \r causes problems for compilers
-// if (osName != null && (osName.startsWith("z") || osName.equalsIgnoreCase("aix")))
-// {
-// tempStr = tempStr.replace('\r', ' ');
-// }
-
- convBytes = tempStr.getBytes(hostEncoding);
-
- if (first)
- { // send first set of bytes
- first = false;
- getDataStore().replaceFile(remotePath, convBytes, convBytes.length, true, byteStreamHandlerId);
- }
- else
- { // append subsequent segments
- getDataStore().replaceAppendFile(remotePath, convBytes, convBytes.length, true, byteStreamHandlerId);
- }
- }
- else // binary
- {
- if (first)
- { // send first set of bytes
- first = false;
- getDataStore().replaceFile(remotePath, buffer, bytesRead, true, byteStreamHandlerId);
- }
- else
- { // append subsequent segments
- getDataStore().replaceAppendFile(remotePath, buffer, bytesRead, true, byteStreamHandlerId);
- }
- }
-
-
- if (/*display != null &&*/ monitor != null)
- {
- long percent = (totalSent * 100) / totalBytes;
-
-
- StringBuffer totalSentBuf = new StringBuffer();
- totalSentBuf.append((totalSent / KB_IN_BYTES));
- totalSentBuf.append(" KB"); //$NON-NLS-1$
-
- StringBuffer totalBuf = new StringBuffer();
- totalBuf.append(totalBytes / KB_IN_BYTES);
- totalBuf.append(" KB"); //$NON-NLS-1$
-
- StringBuffer percentBuf = new StringBuffer();
- percentBuf.append(percent);
- percentBuf.append("%"); //$NON-NLS-1$
-
- monitor.worked(bytesRead);
-
- String str = MessageFormat.format(_percentMsg, new Object[] {totalSentBuf, totalBuf, percentBuf});
- monitor.subTask(str);
-
-
-
-
- isCancelled = monitor.isCanceled();
- }
-
- available = bufInputStream.available();
- }
- // if (listener.uploadHasFailed())
- // {
- // showUploadFailedMessage(listener, source);
- // }
- // else
- {
- transferSuccessful = true;
- }
- }
-
- catch (FileNotFoundException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (UnsupportedEncodingException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (IOException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- catch (Exception e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
- finally
- {
-
- try
- {
-
- if (bufInputStream != null)
- bufInputStream.close();
-
- if (isCancelled)
- {
- return false;
- //throw new RemoteFileCancelledException();
- }
- }
- catch (IOException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error writing file " + remotePath, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
-
- if (totalBytes > 0)
- {
- if (transferSuccessful)
- {
-
-
-// try
-// {
-// listener.waitForUpdate(null, 2);
-//
-// }
-// catch (InterruptedException e)
-// {
-// UniversalSystemPlugin.logError(CLASSNAME + " InterruptedException while waiting for command", e);
-// }
-
- }
-
- //ds.getDomainNotifier().removeDomainListener(listener);
-
-// if (listener.uploadHasFailed())
-// {
-// showUploadFailedMessage(listener, source);
-// }
- }
- }
-
- return true;
- }
-
-
- public boolean download(IProgressMonitor monitor, String remoteParent, String remoteFile, File localFile,
- boolean isBinary, String encoding) throws SystemMessageException
- {
- DataElement universaltemp = getMinerElement();
-
- if (!localFile.exists())
- {
- File parentDir = localFile.getParentFile();
- parentDir.mkdirs();
- }
-
- try
- {
- if (localFile.exists())
- localFile.delete();
- localFile.createNewFile();
- }
- catch (IOException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error creating local file " + destination, e);
-// throw new RemoteFileIOException(e);
- return false;
- }
-
- int mode;
-
- if (isBinary)
- {
- mode = BINARY_MODE;
- }
- else
- {
- mode = TEXT_MODE;
- }
-
- DataStore ds = getDataStore();
- String remotePath = remoteParent + getSeparator(remoteParent) + remoteFile;
-
- DataElement de = getElementFor(remotePath);
- if (de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR))
- {
- // need to refetch
- DStoreHostFile hostFile = (DStoreHostFile)getFile(monitor, remoteParent, remoteFile);
- de = hostFile._element;
- }
- long fileLength = DStoreHostFile.getFileLength(de.getSource());
- if (monitor != null)
- {
- monitor.beginTask(remotePath, (int)fileLength);
- }
-
-
- DataElement remoteElement = ds.createObject(universaltemp, de.getType(), remotePath, String.valueOf(mode));
-
-// String tempRoot = getDataStoreRoot();
- getDataStoreRoot();
-
- DataElement localElement = ds.createObject(universaltemp, de.getType(), localFile.getAbsolutePath(), encoding);
-
- DataElement bufferSizeElement = ds.createObject(universaltemp, "buffer_size", "" + getBufferDownloadSize(), ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DataElement queryCmd = getCommandDescriptor(de,C_DOWNLOAD_FILE);
-
- ArrayList argList = new ArrayList();
- argList.add(remoteElement);
- argList.add(localElement);
- argList.add(bufferSizeElement);
-
- DataElement subject = ds.createObject(universaltemp, de.getType(), remotePath, String.valueOf(mode));
-
- DataElement status = ds.command(queryCmd, argList, subject);
- if (status == null)
- {
- System.out.println("no download descriptor for "+remoteElement); //$NON-NLS-1$
- }
- try
- {
- DownloadListener dlistener = new DownloadListener(monitor, status, localFile, remotePath, fileLength);
- try
- {
- dlistener.waitForUpdate();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- //getStatusMonitor(ds).waitForUpdate(status, monitor);
- }
- catch (Exception e)
- {
- return false;
- }
-
- // now wait till we have all the bytes local
- long localBytes = localFile.length();
- long lastLocalBytes = 0;
- while (localBytes < fileLength && (monitor == null || !monitor.isCanceled()) && lastLocalBytes != localBytes)
- {
- try
- {
- lastLocalBytes= localBytes;
- Thread.sleep(100);
- localBytes = localFile.length();
-
- }
- catch (Exception e)
- {
- }
- }
-
- List resultList = remoteElement.getNestedData();
- DataElement resultChild = null;
-
- for (int i = 0; i < resultList.size(); i++)
- {
-
- resultChild = (DataElement) resultList.get(i);
-
- if (resultChild.getType().equals(DOWNLOAD_RESULT_SUCCESS_TYPE))
- {
- return true;
- }
- else if (resultChild.getType().equals(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
- {
- localFile.delete();
- SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION); //$NON-NLS-1$
- throw new SystemMessageException(msg);
- }
- else if (resultChild.getType().equals(DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION))
- {
- //SystemMessage msg = getMessage();
- //throw new SystemMessageException(msg);
- //UnsupportedEncodingException e = new UnsupportedEncodingException(resultChild.getName());
- //UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
- //throw new RemoteFileIOException(e);
- }
-
- else if (resultChild.getType().equals(DOWNLOAD_RESULT_IO_EXCEPTION))
- {
- localFile.delete();
- SystemMessage msg = getMessage("RSEF1001").makeSubstitution(DOWNLOAD_RESULT_IO_EXCEPTION); //$NON-NLS-1$
- throw new SystemMessageException(msg);
- //IOException e = new IOException(resultChild.getName());
- //UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
- //throw new RemoteFileIOException(e);
- }
- }
-
-// DownloadListener dlistener = new DownloadListener(shell, monitor, getConnectorService(), status, localFile, remotePath, (long) universalFile.getLength());
-// try
-// {
-// dlistener.waitForUpdate();
-// }
-// catch (InterruptedException e)
-// {
-// UniversalSystemPlugin.logError(CLASSNAME + " InterruptedException while waiting for command", e);
-// }
-
-// if (!dlistener.isCancelled())
-// {
-//
-// setDataStoreRoot(tempRoot);
-//
-// ArrayList resultList = remoteElement.getNestedData();
-// DataElement resultChild = null;
-//
-// for (int i = 0; i < resultList.size(); i++)
-// {
-//
-// resultChild = (DataElement) resultList.get(i);
-//
-// if (resultChild.getType().equals(DOWNLOAD_RESULT_SUCCESS_TYPE))
-// {
-// return;
-// }
-// else if (resultChild.getType().equals(DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
-// {
-// FileNotFoundException e = new FileNotFoundException(resultChild.getName());
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
-// throw new RemoteFileIOException(e);
-// }
-// else if (resultChild.getType().equals(DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION))
-// {
-// UnsupportedEncodingException e = new UnsupportedEncodingException(resultChild.getName());
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
-// throw new RemoteFileIOException(e);
-// }
-// else if (resultChild.getType().equals(DOWNLOAD_RESULT_IO_EXCEPTION))
-// {
-// IOException e = new IOException(resultChild.getName());
-// UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
-// throw new RemoteFileIOException(e);
-// }
-// }
-// }
-// else
-// {
-// throw new RemoteFileCancelledException();
-// }
- if (monitor != null)
- {
- //monitor.done();
- }
- return true;
- }
-
- public IHostFile getFile(IProgressMonitor monitor, String remoteParent, String name)
- {
- DataElement de = null;
- if (name.equals(".") && name.equals(remoteParent)) //$NON-NLS-1$
- {
- de = getElementFor(name);
- }
- else
- {
- StringBuffer buf = new StringBuffer(remoteParent);
- buf.append(getSeparator(remoteParent));
- buf.append(name);
- de = getElementFor(buf.toString());
- }
- dsQueryCommand(monitor, de, C_QUERY_GET_REMOTE_OBJECT);
- return new DStoreHostFile(de);
- }
-
- /**
- * Returns what the next part of the path should be, given the current
- * path as parentPath. Returns different separators based on whether the path
- * appears to be a windows, linux, or virtual path.
- * Pass in null to just get the default separator.
- */
- protected String getSeparator(String parentPath)
- {
- if (parentPath == null || parentPath.length() < 2) return "/"; //$NON-NLS-1$
- if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_SEPARATOR))
- return ""; //$NON-NLS-1$
- if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_CANONICAL_SEPARATOR))
- return "/"; //$NON-NLS-1$
- if (parentPath.charAt(1) == ':') //Windows path
- if (parentPath.indexOf(ArchiveHandlerManager.VIRTUAL_CANONICAL_SEPARATOR) != -1)
- if (parentPath.endsWith("/")) //$NON-NLS-1$
- return ""; //already ends in separator //$NON-NLS-1$
- else return "/"; //$NON-NLS-1$
- else if (ArchiveHandlerManager.getInstance().isArchive(new File(parentPath)))
- return ArchiveHandlerManager.VIRTUAL_SEPARATOR;
- else
- if (parentPath.endsWith("\\")) //$NON-NLS-1$
- return ""; //already ends in separator //$NON-NLS-1$
- else return "\\"; //$NON-NLS-1$
- else if (parentPath.charAt(0) == '/') //UNIX path
- if (ArchiveHandlerManager.getInstance().isArchive(new File(parentPath)))
- return ArchiveHandlerManager.VIRTUAL_SEPARATOR;
- else
- if (parentPath.endsWith("/")) //$NON-NLS-1$
- return ""; //already ends in separator //$NON-NLS-1$
- else return "/"; //$NON-NLS-1$
- else return "/"; //unrecognized path //$NON-NLS-1$
- }
-
- protected IHostFile convertToHostFile(DataElement element)
- {
- String type = element.getType();
- IHostFile file = null;
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) ||
- type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR))
- {
- file = new DStoreVirtualHostFile(element);
- }
- else
- {
- file = new DStoreHostFile(element);
- }
- String path = file.getAbsolutePath();
- _fileElementMap.put(path, element);
- return file;
- }
-
- protected IHostFile[] convertToHostFiles(DataElement[] elements)
- {
- ArrayList results = new ArrayList();
- for (int i = 0; i < elements.length; i++)
- {
- if (!elements[i].isDeleted())
- results.add(convertToHostFile(elements[i]));
- }
- return (IHostFile[]) results.toArray(new IHostFile[results.size()]);
- }
-
- public IHostFile getUserHome()
- {
- return getFile(null, ".","."); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public IHostFile createFile(IProgressMonitor monitor, String remoteParent, String fileName) throws SystemMessageException
- {
- String remotePath = remoteParent + getSeparator(remoteParent) + fileName;
- DataElement de = getElementFor(remotePath);
-
-
- DataElement status = dsStatusCommand(monitor, de, C_CREATE_FILE);
-
- if (status == null) return null;
- if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
- return new DStoreHostFile(de);
- else
- {
- throw new SystemMessageException(getMessage("RSEF1302").makeSubstitution(remotePath)); //$NON-NLS-1$
- }
- }
-
- public IHostFile createFolder(IProgressMonitor monitor, String remoteParent, String folderName) throws SystemMessageException
- {
- String remotePath = remoteParent + getSeparator(remoteParent) + folderName;
- DataElement de = getElementFor(remotePath);
-
- DataElement status = dsStatusCommand(monitor, de, C_CREATE_FOLDER);
-
- if (status == null) return null;
- if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
- return new DStoreHostFile(de);
- else
- {
- throw new SystemMessageException(getMessage("RSEF1304").makeSubstitution(remotePath)); //$NON-NLS-1$
- }
-
- }
-
- public boolean delete(IProgressMonitor monitor, String remoteParent, String fileName) throws SystemMessageException
- {
- String remotePath = remoteParent + getSeparator(remoteParent) + fileName;
- DataElement de = getElementFor(remotePath);
- DataElement status = dsStatusCommand(monitor, de, C_DELETE);
- if (status == null) return false;
- if (de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR))
- {
- if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) return true;
- else throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
- }
- else
- {
- return true;
- }
-
- }
-
- public boolean deleteBatch(IProgressMonitor monitor, String[] remoteParents, String[] fileNames) throws SystemMessageException
- {
- if (remoteParents.length == 1) return delete(monitor, remoteParents[0], fileNames[0]);
-
- ArrayList dataElements = new ArrayList(remoteParents.length);
- for (int i = 0; i < remoteParents.length; i++)
- {
- String remotePath = remoteParents[i] + getSeparator(remoteParents[i]) + fileNames[i];
- DataElement de = getElementFor(remotePath);
- if (de != null) dataElements.add(de);
- }
- DataElement status = dsStatusCommand(monitor, (DataElement) dataElements.get(0), dataElements, C_DELETE_BATCH);
- if (status == null) return false;
- if (FileSystemMessageUtil.getSourceMessage(status).startsWith(IServiceConstants.FAILED))
- throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
- else return true;
- }
-
- public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName) throws SystemMessageException
- {
- String remotePath = remoteParent + getSeparator(remoteParent) + oldName;
- DataElement de = getElementFor(remotePath);
- de.setAttribute(DE.A_SOURCE, newName);
-
- DataElement status = dsStatusCommand(monitor, de, C_RENAME);
-
- if (status == null) return false;
- if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
- return true;
- else
- {
- throw new SystemMessageException(getMessage("RSEF1301").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
- }
- }
-
- public boolean rename(IProgressMonitor monitor, String remoteParent, String oldName, String newName, IHostFile oldFile) throws SystemMessageException
- {
- boolean retVal = rename(monitor, remoteParent, oldName, newName);
- String newPath = remoteParent + getSeparator(remoteParent) + newName;
- oldFile.renameTo(newPath);
- return retVal;
- }
-
- public boolean move(IProgressMonitor monitor, String srcParent, String srcName, String tgtParent, String tgtName) throws SystemMessageException
- {
-// String src = srcParent + getSeparator(srcParent) + srcName;
-// String tgt = tgtParent + getSeparator(tgtParent) + tgtName;
-// boolean isVirtual = ArchiveHandlerManager.isVirtual(src) || ArchiveHandlerManager.isVirtual(tgt);
- //if (isVirtual || isArchive)
- {
- if (copy(monitor, srcParent, srcName, tgtParent, tgtName))
- {
- try
- {
- delete(monitor, srcParent, srcName);
- }
- catch (Exception e)
- {
- return false;
- }
- return true;
- }
- return false;
- }
-
-/*
- // handle special characters in source and target strings
- StringBuffer srcBuf = new StringBuffer(src);
- StringBuffer tgtBuf = new StringBuffer(tgt);
-
- for (int i = 0; i < srcBuf.length(); i++)
- {
- char c = srcBuf.charAt(i);
-
- boolean isSpecialChar = isSpecialChar(c);
-
- if (isSpecialChar)
- {
- srcBuf.insert(i, "\\");
- i++;
- }
- }
-
- for (int i = 0; i < tgtBuf.length(); i++)
- {
- char c = tgtBuf.charAt(i);
-
- boolean isSpecialChar = isSpecialChar(c);
-
- if (isSpecialChar)
- {
- tgtBuf.insert(i, "\\");
- i++;
- }
- }
-
- src = "\"" + srcBuf.toString() + "\"";
- tgt = "\"" + tgtBuf.toString() + "\"";
-
- if (systemType.equals(SYSTEMTYPE_WINDOWS))
- {
- if (sourceFolderOrFile.isDirectory() && sourceFolderOrFile.getAbsolutePath().charAt(0) != targetFolder.getAbsolutePath().charAt(0))
- {
- // special case - move across drives
- command = "xcopy " + src + " " + tgt + " /S /E /K /O /Q /H /I && rmdir /S /Q " + src;
- }
- else
- {
- command = "move " + src + " " + tgt;
- }
- }
- else
- {
- command = "mv " + src + " " + tgt;
- }
-
- UniversalCmdSubSystemImpl cmdSubSystem = getUniversalCmdSubSystem();
- IRemoteFile runFile = sourceFolderOrFile;
-
- if (cmdSubSystem != null)
- {
- try
- {
- done = cmdSubSystem.runRemoteCommand(runFile, command);
- runFile.getParentRemoteFile().markStale(true);
- runFile.markStale(true);
-
- }
- catch (InterruptedException e)
- {
- done = false;
- }
- }
- else
- SystemPlugin.logWarning(CLASSNAME + " cmdSubSystem is null in move");
-
- return done;
- */
-
- }
-
- /**
- * Checks whether the given character is a special character in the shell. A special character is
- * '$', '`', '"' and '\'.
- * @param c the character to check.
- * @return <code>true</code> if the character is a special character, <code>false</code> otherwise.
- */
- protected boolean isSpecialChar(char c) {
-
- if ((c == '$') || (c == '`') || (c == '"') || (c == '\\')) {
- return true;
- }
- else {
- return false;
- }
- }
-
- public boolean copy(IProgressMonitor monitor, String srcParent, String srcName, String tgtParent, String tgtName) throws SystemMessageException
- {
- DataStore ds = getDataStore();
- String srcRemotePath = srcParent + getSeparator(srcParent) + srcName;
- DataElement srcDE = getElementFor(srcRemotePath);
-
- DataElement tgtDE = getElementFor(tgtParent);
- if (tgtDE.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR))
- {
- dsQueryCommand(monitor, tgtDE, C_QUERY_GET_REMOTE_OBJECT);
- }
-
- DataElement cpCmd = getCommandDescriptor(tgtDE, C_COPY);
-
- if (cpCmd != null)
- {
- ArrayList args = new ArrayList();
- args.add(srcDE);
- DataElement nameObj = ds.createObject(null, "name", tgtName); //$NON-NLS-1$
- args.add(nameObj);
- DataElement status = ds.command(cpCmd, args, tgtDE, true);
-
-
- try
- {
- getStatusMonitor(ds).waitForUpdate(status, monitor);
-
- if (status.getAttribute(DE.A_SOURCE).equals(FAILED)) {
-
- throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcName)); //$NON-NLS-1$
- /*
- // for an unexpected error, we don't have an error message from the server
- if (errMsg.equals(UNEXPECTED_ERROR)) {
- msg = SystemPlugin.getPluginMessage(MSG_ERROR_UNEXPECTED).getLevelOneText();
- }
- else {
- msg = errMsg;
- }
-
-
- throw new RemoteFileIOException(new Exception(msg));
- /*/
-
- }
- }
- catch (InterruptedException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + " InterruptedException while waiting for command", e);
- }
- return true;
- }
- return false;
- }
-
- public boolean copyBatch(IProgressMonitor monitor, String[] srcParents, String[] srcNames, String tgtParent) throws SystemMessageException
- {
- DataStore ds = getDataStore();
-
- DataElement tgtDE = getElementFor(tgtParent);
- DataElement cpCmd = getCommandDescriptor(tgtDE, C_COPY_BATCH);
-
- if (cpCmd != null)
- {
- ArrayList args = new ArrayList();
- for (int i = 0; i < srcParents.length; i++)
- {
- String srcRemotePath = srcParents[i] + getSeparator(srcParents[i]) + srcNames[i];
- DataElement srcDE = getElementFor(srcRemotePath);
- args.add(srcDE);
- }
- DataElement status = ds.command(cpCmd, args, tgtDE, true);
-
- try
- {
- getStatusMonitor(ds).waitForUpdate(status, monitor);
-
- if (status.getAttribute(DE.A_SOURCE).equals(FAILED)) {
- throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcNames[0])); //$NON-NLS-1$
- }
- }
- catch (InterruptedException e)
- {
-// UniversalSystemPlugin.logError(CLASSNAME + " InterruptedException while waiting for command", e);
- }
- return true;
- }
- return false;
- }
-
-
-
-
-
- public IHostFile[] getRoots(IProgressMonitor monitor)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
- DataStore ds = getDataStore();
- DataElement universaltemp = getMinerElement();
-
- // create filter descriptor
- DataElement deObj = ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, "", "", "", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DataElement[] results = dsQueryCommand(monitor, deObj, C_QUERY_ROOTS);
-
- return convertToHostFiles(results);
- }
-
-
-
-
- public IHostFile[] getFolders(IProgressMonitor monitor, String remoteParent, String fileFilter)
- {
- return fetch(monitor, remoteParent, fileFilter, C_QUERY_VIEW_FOLDERS);
- }
-
- public IHostFile[] getFiles(IProgressMonitor monitor, String remoteParent, String fileFilter)
- {
- return fetch(monitor, remoteParent, fileFilter, C_QUERY_VIEW_FILES);
- }
-
- public IHostFile[] getFilesAndFolders(IProgressMonitor monitor, String remoteParent, String fileFilter)
- {
- return fetch(monitor, remoteParent, fileFilter, C_QUERY_VIEW_ALL);
- }
-
- protected DataElement getElementFor(String path)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
-
-
- String normalizedPath = PathUtility.normalizeUnknown(path);
- DataElement element = (DataElement)_fileElementMap.get(normalizedPath);
- if (element != null && element.isDeleted())
- {
- _fileElementMap.remove(normalizedPath);
- element = null;
- }
- if (element == null || element.isDeleted())
- {
- DataElement universaltemp = getMinerElement();
- element = getDataStore().createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, normalizedPath, normalizedPath, "", false); //$NON-NLS-1$
- }
- return element;
- }
-
- protected IHostFile[] fetch(IProgressMonitor monitor, String remoteParent, String fileFilter, String queryType)
- {
- DataStore ds = getDataStore();
-
-
- // create filter descriptor
- DataElement deObj = getElementFor(remoteParent);
- if (deObj == null)
- {
- DataElement universaltemp = getMinerElement();
- ds.createObject(universaltemp, UNIVERSAL_FILTER_DESCRIPTOR, remoteParent, remoteParent, "", false); //$NON-NLS-1$
- }
-
- DataElement attributes = getAttributes(fileFilter, true);
- ArrayList args = new ArrayList(1);
- args.add(attributes);
-
- DataElement[] results = dsQueryCommand(monitor, deObj, args, queryType);
- return convertToHostFiles(results);
- }
-
- public boolean isCaseSensitive()
- {
- return true;
- }
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java
deleted file mode 100644
index 9bab37168..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreHostFile.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.files;
-
-import java.io.File;
-
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
-import org.eclipse.rse.services.clientserver.IServiceConstants;
-import org.eclipse.rse.services.clientserver.PathUtility;
-import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
-import org.eclipse.rse.services.files.IHostFile;
-
-public class DStoreHostFile implements IHostFile
-{
- public static final int ATTRIBUTE_MODIFIED_DATE=1;
- public static final int ATTRIBUTE_SIZE = 2;
- public static final int ATTRIBUTE_CLASSIFICATION =11;
- public static final int ATTRIBUTE_IS_HIDDEN=3;
- public static final int ATTRIBUTE_CAN_WRITE=4;
- public static final int ATTRIBUTE_CAN_READ=5;
-
-
- protected DataElement _element;
- protected boolean _isArchive;
-
- public DStoreHostFile(DataElement element)
- {
- _element = element;
- _isArchive = internalIsArchive();
- }
-
- public DataElement getDataElement()
- {
- return _element;
- }
-
- public static String getNameFromPath(String path)
- {
- int lastSlash = path.lastIndexOf('/');
- if (lastSlash == -1) // account for windows
- {
- lastSlash = path.lastIndexOf('\\');
- }
- if (lastSlash > 0 && lastSlash != path.length() - 1)
- {
- return path.substring(lastSlash + 1);
- }
- return path;
- }
-
- public static String getParentPathFromPath(String path)
- {
- int lastSlash = path.lastIndexOf('/');
- if (lastSlash == -1) // acount for windows
- {
- lastSlash = path.lastIndexOf('\\');
- }
- if (lastSlash > 0 && lastSlash != path.length() - 1)
- {
- return path.substring(0, lastSlash);
- }
- return path;
- }
-
- public String getName()
- {
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR))
- {
- // filter doesn't separate path from name
- String path = _element.getName();
- return getNameFromPath(path);
- }
- else if (isRoot())
- {
- return _element.getValue();
- }
- else
- {
- String name = _element.getName();
- String parentPath = getParentPath();
- if (name.length() == 0 &&
- (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$
- {
-
- return parentPath;
- }
- if (name.length() == 0)
- {
- String path = _element.getValue();
- int lastSep = path.lastIndexOf('/');
- if (lastSep == -1)
- lastSep = path.lastIndexOf('\\');
- name = path.substring(lastSep + 1);
- return name;
- }
-
- return name;
- }
- }
-
- public String getParentPath()
- {
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR))
- {
- // filter doesn't separate path from name
- String path = _element.getName();
- return getParentPathFromPath(path);
- }
- else
- {
- if (_element.getName().length() == 0)
- {
- // derive from value
- String fullPath = _element.getValue();
- int sep = fullPath.lastIndexOf('/');
- if (sep == -1)
- sep = fullPath.lastIndexOf('\\');
-
- if (sep == -1)
- return fullPath;
- return fullPath.substring(0, sep);
- }
- else
- {
- return _element.getValue();
- }
- }
- }
-
- public boolean isHidden()
- {
- String name = getName();
- if (name == null || name.length() == 0)
- {
- return false;
- }
- else
- {
-
- if (name.charAt(0) == '.')
- {
- return true;
- }
- else if (isRoot())
- {
- return false;
- }
- else
- {
- String str = getAttribute(_element.getSource(), ATTRIBUTE_IS_HIDDEN);
- return(str.equals("true")); //$NON-NLS-1$
- }
- }
- }
-
- public boolean isDirectory()
- {
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR)
- || type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR))
- {
- return true;
- }
- return false;
-
- }
-
- public boolean isRoot()
- {
- String parentPath = _element.getValue();
- String name = _element.getName();
- if (parentPath == null || parentPath.length() == 0 ||
- (name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$
- )
-
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public boolean isFile()
- {
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)
- || type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR)
- || type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR))
- {
- return true;
- }
- return false;
- }
-
- public boolean exists()
- {
- if (_element.isDeleted())
- return false;
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) ||
- type.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR) ||
- type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) ||
- type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR) ||
- type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
-
-
- public String getAbsolutePath()
- {
- String name = _element.getName();
- if (name.length() == 0)
- {
- return _element.getValue();
- }
- String parentPath = getParentPath();
-
-
- String type = _element.getType();
- if (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR))
- {
- return name;
- }
-
- if (name.length() == 0)
- {
- return PathUtility.normalizeUnknown(parentPath);
- }
- else
- {
- return PathUtility.normalizeUnknown(parentPath + "/" + name); //$NON-NLS-1$
- }
- }
-
- public long getSize()
- {
- return getFileLength(_element.getSource());
- }
-
- public long getModifiedDate()
- {
- return getModifiedDate(_element.getSource());
-
- }
-
- public String getClassification()
- {
- String classification = getClassification(_element.getSource());
- if (classification == null)
- {
- if (isFile())
- {
- classification = "file"; //$NON-NLS-1$
- }
- else
- {
- classification = "directory"; //$NON-NLS-1$
- }
- }
- return classification;
- }
-
- protected static String getClassification(String attributes)
- {
- return getAttribute(attributes, ATTRIBUTE_CLASSIFICATION);
- }
-
- protected static long getFileLength(String attributes)
- {
- String str = getAttribute(attributes, ATTRIBUTE_SIZE);
- return Long.parseLong(str);
- }
-
- protected static long getModifiedDate(String attributes)
- {
- String str = getAttribute(attributes, ATTRIBUTE_MODIFIED_DATE);
- return Long.parseLong(str);
- }
-
- protected static String getAttribute(String attributes, int index)
- {
- String[] str = attributes.split("\\"+IServiceConstants.TOKEN_SEPARATOR); //$NON-NLS-1$
- if (str.length > index)
- {
- return str[index];
- }
- else
- {
- return null;
- }
- }
-
- public void renameTo(String newAbsolutePath)
- {
- String current = getName();
- if (newAbsolutePath.endsWith(current))
- {
- // data element already updated
- }
- else
- {
- int lastSep = newAbsolutePath.lastIndexOf('/');
- if (lastSep == -1)
- lastSep = newAbsolutePath.lastIndexOf('\\');
-
- String newName = newAbsolutePath.substring(lastSep + 1);
-
- _element.setAttribute(DE.A_NAME, newName);
- }
-
- _isArchive = internalIsArchive();
- }
-
- protected boolean internalIsArchive()
- {
- String path = getAbsolutePath();
- return ArchiveHandlerManager.getInstance().isArchive(new File(path))
- && !ArchiveHandlerManager.isVirtual(path);
- }
-
- public boolean isArchive()
- {
- return _isArchive;
- }
-
- public boolean canRead() {
- String str = getAttribute(_element.getSource(), ATTRIBUTE_CAN_READ);
- return(str.equals("true")); //$NON-NLS-1$
- }
-
- public boolean canWrite() {
- String str = getAttribute(_element.getSource(), ATTRIBUTE_CAN_WRITE);
- return(str.equals("true")); //$NON-NLS-1$
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreVirtualHostFile.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreVirtualHostFile.java
deleted file mode 100644
index deac51563..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreVirtualHostFile.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.files;
-
-import org.eclipse.dstore.core.model.DataElement;
-
-public class DStoreVirtualHostFile extends DStoreHostFile
-{
-
- public static final int ATTRIBUTE_COMMENT = 6;
- public static final int ATTRIBUTE_COMPRESSEDSIZE = 7;
- public static final int ATTRIBUTE_COMPRESSIONMETHOD = 8;
- public static final int ATTRIBUTE_COMPRESSIONRATIO = 9;
- public static final int ATTRIBUTE_EXPANDEDSIZE = 10;
-
- public DStoreVirtualHostFile(DataElement element)
- {
- super(element);
- }
-
- protected static long getCompressedSize(String attributes)
- {
- String str = getAttribute(attributes, ATTRIBUTE_COMPRESSEDSIZE);
- return Long.parseLong(str);
- }
-
- protected static long getExpandedSize(String attributes)
- {
- String str = getAttribute(attributes, ATTRIBUTE_EXPANDEDSIZE);
- return Long.parseLong(str);
- }
-
- protected static double getCompressionRatio(String attributes)
- {
- String str = getAttribute(attributes, ATTRIBUTE_COMPRESSIONRATIO);
- return Double.parseDouble(str);
- }
-
- public String getComment()
- {
- return getAttribute(_element.getSource(), ATTRIBUTE_COMMENT);
- }
-
- public long getCompressedSize()
- {
- return getCompressedSize(_element.getSource());
- }
-
- public String getCompressionMethod()
- {
- return getAttribute(_element.getSource(), ATTRIBUTE_COMPRESSIONMETHOD);
- }
-
- public double getCompressionRatio()
- {
- return getCompressionRatio(_element.getSource());
- }
-
- public long getExpandedSize()
- {
- return getExpandedSize(_element.getSource());
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java
deleted file mode 100644
index 20002588b..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreHostProcess.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.processes;
-
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.rse.services.clientserver.processes.IHostProcess;
-
-/**
- * This class implements the IRemoteClientProcess interface by wrappering a DataElement
- * and returning process attribute information from the underlying DataElement.
- * It also contains client-specific methods for getting contextual information about
- * the process such as the associated subsystem and connection.
- * @author mjberger
- *
- */
-public class DStoreHostProcess implements IHostProcess, org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants, IAdaptable, org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants
-{
- public static final boolean ROOT_TRUE = true;
- public static final boolean ROOT_FALSE = false;
-
- protected String _name, _username;
- protected long _pid = -1;
- protected long _ppid = -1;
- protected long _tgid = -1;
- protected long _tracerPid = -1;
- protected long _uid = -1;
- protected long _gid = -1;
-
- protected String _label = null;
- protected String _fullyQualifiedProcess;
-
- protected boolean _isRoot = false;
-
- protected Object _remoteObj;
-
- // master hash map
- protected HashMap _contents = new HashMap();
-
- /* container properties */
- protected boolean _isStale = false;
-
- // properties
- protected HashMap _properties = new HashMap();
- protected HashMap _propertyStates = new HashMap();
-
- /**
- * Constructor that takes a dataElement object containing the process information, and
- * a parent process.
- */
- public DStoreHostProcess(DataElement dataElementObj)
- {
- init(dataElementObj);
- }
-
- protected void init(DataElement dataElementObj)
- {
- setProcess(dataElementObj);
- String name = dataElementObj.getName();
- _fullyQualifiedProcess = "/proc/" + name; //$NON-NLS-1$
-
- // if we already have retrieved file properties
- // set them now
- String s = dataElementObj.getAttribute(DE.A_VALUE);
- if (s != null && s.length() > 0)
- {
- getAttributes(null);
- }
- }
-
- /**
- * The Properties of the process are returned from the miner in a string that can be parsed using
- * the String.split method, with delimiter "|".
- * You can also set all attributes at once with your own string passed as a parameter, as long
- * as the string is in the same format as outlined below (pass in null to use the DataElement's string):
- * <p> The string contains properties of the object in the following order
- * <ul>
- * <li>Process Id (pid) - long
- * <li>Executable name - String
- * <li>Status - char
- * <li>Tgid - long
- * <li>Process Parent id (ppid) - long
- * <li>Tracer pid - long
- * <li>User id (uid) - int
- * <li>Username - String
- * <li>Group id (gid) - int
- * <li>VM Size - long
- * <li>VM RSS - long
- * </ul>
- */
- protected String getAttributes(String newAttributes)
- {
- DataElement deObj = (DataElement) this.getObject();
-
- String s = null;
-
- if (newAttributes == null) s = deObj.getAttribute(DE.A_VALUE);
- else s = newAttributes;
-
- if (s != null && s.length() > 0)
- {
- String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$
- int tokens = str.length;
- if (tokens > 1)
- {
- try
- {
- setPid(str[PROCESS_ATTRIBUTES_INDEX_PID]);
-
- setName(str[PROCESS_ATTRIBUTES_INDEX_EXENAME]);
-
- setTgid(str[PROCESS_ATTRIBUTES_INDEX_TGID]);
-
- setPPid(str[PROCESS_ATTRIBUTES_INDEX_PPID]);
-
- if (_ppid == 0) _isRoot = true;
-
- setTracerPid(str[PROCESS_ATTRIBUTES_INDEX_TRACERPID]);
-
- setUid(str[PROCESS_ATTRIBUTES_INDEX_UID]);
-
- setUsername(str[PROCESS_ATTRIBUTES_INDEX_USERNAME]);
-
- setGid(str[PROCESS_ATTRIBUTES_INDEX_GID]);
-
- setLabel(str[PROCESS_ATTRIBUTES_INDEX_EXENAME]);
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.getAttributes(). Attributes = " + s);
- }
- }
- }
- return s;
- }
-
- /**
- * Set the DataElement for this object
- */
- public void setProcess(Object dataElementObj)
- {
- _remoteObj = dataElementObj;
- }
-
- /**
- * Returns the DataElement for this object
- */
- public Object getObject()
- {
- return _remoteObj;
- }
-
- public String getAbsolutePath()
- {
- return _fullyQualifiedProcess;
- }
-
- public String getLabel()
- {
- return _label;
- }
-
- public long getPid()
- {
- return _pid;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String getState()
- {
- String state = getSubAttribute(PROCESS_ATTRIBUTES_INDEX_STATUS);
- if (state == null)
- {
- //SystemPlugin.logError("Error in UniversalProcessImpl.getAttributes(): status of process " + getPid() + " is not given.");
- return " "; //$NON-NLS-1$
- }
- else return state;
- }
-
- public long getTgid()
- {
- return _tgid;
- }
-
- public long getTracerPid()
- {
- return _tracerPid;
- }
-
- public long getUid()
- {
- return _uid;
- }
-
- public String getUsername()
- {
- return _username;
- }
-
- public long getGid()
- {
- return _gid;
- }
-
- protected void setAbsolutePath(String path)
- {
- _fullyQualifiedProcess = path;
- }
-
- protected void setGid(long gid)
- {
- _gid = gid;
- }
-
- protected void setGid(String newGid)
- {
- try
- {
- _gid = Long.parseLong(newGid);
- }
- catch (NumberFormatException e)
- {
- //SystemPlugin.logError("Error in UniversalProcessImpl.setGid: Could not parse gid into integer.");
- _gid = -1;
- }
- }
-
- public void setLabel(String newLabel)
- {
- _label = newLabel;
- }
-
- protected void setName(String exeName)
- {
- _name = exeName;
- }
-
- protected void setPid(long newPid)
- {
- _pid = newPid;
- }
-
- protected void setPid(String newPid)
- {
- try
- {
- _pid = Long.parseLong(newPid);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setPid: Could not parse pid into integer.");
- _pid = -1;
- }
- }
-
- protected void setState(String newState)
- {
- setSubAttribute(PROCESS_ATTRIBUTES_INDEX_STATUS, newState);
- }
-
- protected void setTgid(long tgid)
- {
- _tgid = tgid;
- }
-
- protected void setTgid(String newTgid)
- {
- try
- {
- _tgid = Long.parseLong(newTgid);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setTgid: Could not parse tgid into integer.");
- _tgid = -1;
- }
- }
-
- protected void setTracerPid(long tracerPid)
- {
- _tracerPid = tracerPid;
- }
-
- protected void setTracerPid(String newTracerPid)
- {
- try
- {
- _tracerPid = Long.parseLong(newTracerPid);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setTracerPid: Could not parse tracerpid into integer.");
- _tracerPid = -1;
- }
- }
-
- protected void setUid(long uid)
- {
- _uid = uid;
- }
-
- protected void setUid(String newUid)
- {
- try
- {
- _uid = Long.parseLong(newUid);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setUid: Could not parse uid into integer.");
- _uid = -1;
- }
- }
-
- protected void setUsername(String username)
- {
- _username = username;
- }
-
- public Object getAdapter(Class adapterType)
- {
- return Platform.getAdapterManager().getAdapter(this, adapterType);
- }
-
- public long getPPid()
- {
- return _ppid;
- }
-
- protected void setPPid(long newPPid)
- {
- _ppid = newPPid;
- }
-
- protected void setPPid(String newPPid)
- {
- try
- {
- _ppid = Long.parseLong(newPPid);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setPPid: Could not parse ppid into integer.");
- _ppid = -1;
- }
- }
-
- public boolean isRoot()
- {
- return _isRoot;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.clientserver.processes.IHostProcess#getAllProperties()
- */
- public String getAllProperties()
- {
- return getAttributes(null);
- }
-
- /**
- * @param allProperties
- */
- protected void setAllProperties(String allProperties)
- {
- getAttributes(allProperties);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.clientserver.processes.IHostProcess#getVmSizeInKB()
- */
- public long getVmSizeInKB()
- {
- String sizeStr = getSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMSIZE);
- if (sizeStr == null) return 0;
- long vmsize = 0;
- try
- {
- vmsize = Long.parseLong(sizeStr);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.getVMSizeInKB: Could not parse VM Size into integer.");
- return 0;
- }
- return vmsize;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.clientserver.processes.IHostProcess#getVmRSSInKB()
- */
- public long getVmRSSInKB()
- {
- String sizeStr = getSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMRSS);
- if (sizeStr == null) return 0;
- long vmrss = 0;
- try
- {
- vmrss = Long.parseLong(sizeStr);
- }
- catch (NumberFormatException e)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.getVMRSSInKB: Could not parse VM RSS into integer.");
- return 0;
- }
- return vmrss;
- }
-
-
- /**
- * @param size the size to set
- */
- protected void setVmSizeInKB(long size)
- {
- String sizeStr = ""; //$NON-NLS-1$
- sizeStr = sizeStr + size;
- setSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMSIZE, sizeStr);
- }
-
- /**
- * @param size the size to set
- */
- protected void setVmRSSInKB(long size)
- {
- String sizeStr = ""; //$NON-NLS-1$
- sizeStr = sizeStr + size;
- setSubAttribute(PROCESS_ATTRIBUTES_INDEX_VMRSS, sizeStr);
- }
-
- /**
- * Returns a subattribute of the A_VALUE of this process's associated
- * data element.
- * @param attIndex the index of the desired subattribute
- * @return a string containing that attribute, or null if that attribute
- * is not specified, if the dataelement does not exist, or if the attIndex
- * is out of bounds.
- */
- protected String getSubAttribute(int attIndex)
- {
- DataElement deObj = (DataElement) this.getObject();
- if (deObj == null) return null;
-
- String s = deObj.getAttribute(DE.A_VALUE);
-
- if (s != null && s.length() > 0)
- {
- String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$
- if (attIndex >= str.length) return null;
- if (str[attIndex] == null || str[attIndex].equals("")) return null; //$NON-NLS-1$
- else return str[attIndex];
- }
- else return null;
- }
-
- /**
- * Helper method for setting any attributes of the underlying DataElement.
- * @param attIndex
- * @param newSubAttribute
- */
- protected void setSubAttribute(int attIndex, String newSubAttribute)
- {
- DataElement deObj = (DataElement) this.getObject();
- if (deObj == null)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setSubAttribute: Could not access dataelement.");
- return;
- }
- String s = deObj.getAttribute(DE.A_VALUE);
-
- if (s != null && s.length() > 0)
- {
- String[] str = s.split("\\"+TOKEN_SEPARATOR); //$NON-NLS-1$
- if (attIndex >= str.length)
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setSubAttribute: Attribute index out of bounds.");
- return;
- }
- s = ""; //$NON-NLS-1$
- str[attIndex] = newSubAttribute;
- for (int i = 0; i < str.length; i++)
- {
- if (i == str.length - 1) s = s + str[i];
- else s = s + str[i] + TOKEN_SEPARATOR;
- }
- deObj.setAttribute(DE.A_VALUE, s);
- DataStore ds = deObj.getDataStore();
- ds.refresh(deObj);
- }
- else
- {
- // SystemPlugin.logError("Error in UniversalProcessImpl.setSubAttribute: Dataelement did not contain an attribute string.");
- return;
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java
deleted file mode 100644
index 0d91d3f21..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/processes/DStoreProcessService.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.processes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.dstore.universal.miners.processes.IUniversalProcessDataStoreConstants;
-import org.eclipse.rse.dstore.universal.miners.processes.UniversalProcessMiner;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.clientserver.processes.IHostProcess;
-import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter;
-import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants;
-import org.eclipse.rse.services.dstore.ServiceResources;
-import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
-import org.eclipse.rse.services.processes.AbstractProcessService;
-import org.eclipse.rse.services.processes.IProcessService;
-
-
-public class DStoreProcessService extends AbstractProcessService implements IProcessService, IUniversalProcessDataStoreConstants, ISystemProcessRemoteConstants
-{
- protected IDataStoreProvider _provider;
- protected DataElement _minerElement = null;
- protected DStoreStatusMonitor _statusMonitor;
- protected DataElement _procMinerStatus;
- protected String[] _statusTypes;
- protected String _userName;
-
- public DStoreProcessService(IDataStoreProvider provider)
- {
- _provider = provider;
- }
-
- public String getName()
- {
- return ServiceResources.DStore_Process_Service_Label;
- }
-
- public String getDescription()
- {
- return ServiceResources.DStore_Process_Service_Description;
- }
-
- public IHostProcess[] listAllProcesses(IProgressMonitor monitor, IHostProcessFilter filter) throws SystemMessageException
- {
- if (!isInitialized())
- {
- waitForInitialize(monitor);
- }
- IHostProcess[] processes = null;
-
- DataStore ds = getDataStore();
- DataElement universaltemp = getMinerElement();
-
- // create filter descriptor
- DataElement deObj;
- deObj = ds.find(universaltemp, DE.A_NAME, UNIVERSAL_PROCESS_ROOT, 1);
- if (deObj == null) deObj = ds.createObject(universaltemp, UNIVERSAL_PROCESS_FILTER, UNIVERSAL_PROCESS_ROOT, "", "", false); //$NON-NLS-1$ //$NON-NLS-2$
- deObj.setAttribute(DE.A_SOURCE, filter.toString());
-
- // query
- DataElement queryCmd = ds.localDescriptorQuery(deObj.getDescriptor(), C_PROCESS_FILTER_QUERY_ALL);
-
- if (queryCmd != null)
- {
- DataElement status = ds.command(queryCmd, deObj, true);
-
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- try
- {
- smon.waitForUpdate(status);
- }
- catch (InterruptedException e)
- {
- throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
- }
- // get results
- List nested = deObj.getNestedData();
- if (nested != null)
- {
- Object[] results = nested.toArray();
-
- String message = status.getAttribute(DE.A_VALUE);
- if (!message.equals(PROCESS_MINER_SUCCESS))
- {
- throw new SystemMessageException(getMessage("RSEPG1301")); //$NON-NLS-1$
- }
-
- // convert objects to remote files
- String userName = getRemoteUserName();
- if (userName != null && filter.getUsername().equals("${user.id}")) //$NON-NLS-1$
- filter.setUsername(getRemoteUserName());
- processes = convertObjsToHostProcesses(filter, results);
- }
- }
- else
- {
- //SystemPlugin.logWarning(CLASSNAME + " queryCmd is null in listRoots");
- }
-
- return processes;
- }
-
- /**
- * Helper method to convert DataElement objects to IRemoteClientProcess objects.
- */
- protected IHostProcess[] convertObjsToHostProcesses(IHostProcessFilter processFilter, Object[] objs)
- {
- if (objs == null)
- return null;
-
- ArrayList list = new ArrayList(objs.length);
-
- for (int idx = 0; idx < objs.length; idx++)
- {
- DataElement de = (DataElement) objs[idx];
- if (!de.isDeleted())
- {
- if (processFilter == null || processFilter.allows(de.getValue()))
- {
- DStoreHostProcess newProcess = new DStoreHostProcess(de);
- list.add(newProcess);
- }
- }
- }
-
- IHostProcess[] processes = new IHostProcess[list.size()];
-
- for (int idx = 0; idx < list.size(); idx++)
- {
- processes[idx] = (IHostProcess) list.get(idx);
- }
-
- return processes;
- }
-
- /**
- * Helper method to return the DataStore object needed by comm layer.
- */
- protected DataStore getDataStore()
- {
- return _provider.getDataStore();
- }
-
- protected DataElement getMinerElement()
- {
-
- if (_minerElement == null || _minerElement.getDataStore() != getDataStore())
- {
- _minerElement = getDataStore()
- .findMinerInformation(
- "org.eclipse.rse.dstore.universal.miners.processes.UniversalProcessMiner"); //$NON-NLS-1$
- }
- return _minerElement;
- }
-
- public DStoreStatusMonitor getStatusMonitor(DataStore dataStore)
- {
- if (_statusMonitor == null || _statusMonitor.getDataStore() != dataStore)
- {
- _statusMonitor = new DStoreStatusMonitor(dataStore);
- }
- return _statusMonitor;
- }
-
- public boolean kill(IProgressMonitor monitor, long PID, String signal) throws SystemMessageException
- {
- try
- {
- DataStore ds = getDataStore();
-
- // run kill command on host
- DStoreHostProcess process = (DStoreHostProcess) getProcess(monitor, PID);
-
- // if there is no process, simply return true
- if (process == null) {
- return true;
- }
-
- DataElement deObj = (DataElement) process.getObject();
- DataElement killCmd = ds.localDescriptorQuery(deObj.getDescriptor(), C_PROCESS_KILL);
- deObj.setAttribute(DE.A_SOURCE, signal);
-
- if (killCmd != null)
- {
- DataElement status = ds.command(killCmd, deObj, true);
-
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- smon.waitForUpdate(status);
-
- // get results
- String message = status.getAttribute(DE.A_VALUE);
- if (message.equals(PROCESS_MINER_SUCCESS)) return true;
- else
- {
- SystemMessage msg = getMessage("RSEPG1300"); //$NON-NLS-1$
- msg.makeSubstitution(process.getName() + " (" + process.getPid() + ")", message); //$NON-NLS-1$ //$NON-NLS-2$
- throw new SystemMessageException(msg);
- }
- }
- else
- {
- // SystemPlugin.logWarning(CLASSNAME + " queryCmd is null in listRoots");
- }
- }
- catch (InterruptedException e)
- {
- throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
- }
- return false;
- }
-
- public String[] getSignalTypes()
- {
- if (_statusTypes != null)
- {
- return _statusTypes;
- }
- else
- {
- _statusTypes = internalGetSignalTypes();
- }
- return _statusTypes;
- }
-
- /**
- * Returns a list of the types of signals that can be sent to
- * a process on the remote system.
- * @return the signal types, or null if there are none, or they cannot be found.
- */
- private String[] internalGetSignalTypes()
- {
- try
- {
- DataElement sigTypesElement = getSignalTypesMinerElement();
- String sigTypesOutput = sigTypesElement.getValue();
- String[] lines = sigTypesOutput.trim().split("\\s+"); //$NON-NLS-1$
- if (lines == null) throw new Exception();
- return lines;
- }
- catch (Exception e)
- {
- // SystemPlugin.logError("UniversalProcessSubSystemImpl.getSignalTypes() 'kill -l' command failed.", e);
- return null;
- }
- }
-
- protected DataElement getSignalTypesMinerElement()
- {
- return getDataStore().find(_minerElement, DE.A_NAME, "universal.killinfo"); //$NON-NLS-1$
- }
-
- public void initService(IProgressMonitor monitor)
- {
- initMiner(monitor);
- }
-
- public void uninitService(IProgressMonitor monitor)
- {
- _minerElement = null;
- _procMinerStatus = null;
- }
-
- public boolean isInitialized()
- {
- if (_procMinerStatus != null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- return smon.determineStatusDone(_procMinerStatus);
- }
- return false;
- }
-
- protected void waitForInitialize(IProgressMonitor monitor)
- {
- if (_procMinerStatus!= null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- try
- {
- smon.waitForUpdate(_procMinerStatus, monitor);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- getMinerElement();
- }
- }
-
- protected void initMiner(IProgressMonitor monitor)
- {
- DataElement fsElement = getMinerElement();
- if (fsElement == null)
- {
- if (getServerVersion() >= 8)
- {
- String minerId = getMinerId();
- String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$
- monitor.beginTask(message, IProgressMonitor.UNKNOWN);
- DataStore ds = getDataStore();
- if (_minerElement == null || _minerElement.getDataStore() != ds)
- {
- if (ds != null)
- {
- _procMinerStatus = ds.activateMiner(minerId);
-
- }
- }
- }
- }
- monitor.done();
- }
-
- /**
- * Get the username used to connect to the remote machine
- */
- public String getRemoteUserName()
- {
- if (_userName == null)
- {
- DataStore ds = getDataStore();
-
- DataElement encodingElement = ds.createObject(null, UNIVERSAL_PROCESS_TEMP, ""); //$NON-NLS-1$
-
- DataElement queryCmd = ds.localDescriptorQuery(encodingElement.getDescriptor(), C_PROCESS_QUERY_USERNAME);
- DStoreStatusMonitor monitor = getStatusMonitor(ds);
- DataElement status = ds.command(queryCmd, encodingElement, true);
- try
- {
- monitor.waitForUpdate(status);
- }
- catch (Exception e)
- {
- }
-
- _userName = encodingElement.getValue();
- }
- return _userName;
- }
-
- protected String getMinerId()
- {
- return UniversalProcessMiner.MINER_ID;
- }
-
- public int getServerVersion()
- {
- return getDataStore().getServerVersion();
- }
-
- public int getServerMinor()
- {
- return getDataStore().getServerMinor();
- }
-
- protected String getProcessMinerId()
- {
- return UniversalProcessMiner.MINER_ID;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/rmtservice/DStoreRemoteServiceService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/rmtservice/DStoreRemoteServiceService.java
deleted file mode 100644
index 868e0e1fe..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/rmtservice/DStoreRemoteServiceService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.rmtservice;
-
-import org.eclipse.dstore.core.java.IRemoteClassInstance;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.dstore.AbstractDStoreService;
-
-public class DStoreRemoteServiceService extends AbstractDStoreService
-{
-
- public DStoreRemoteServiceService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
- {
- super(dataStoreProvider, msgProvider);
- }
-
- protected String getMinerId()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void runRemoteService(IRemoteClassInstance serviceClass)
- {
- getDataStore().runRemoteClassInstance(serviceClass);
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchResultConfiguration.java
deleted file mode 100644
index 92c91573b..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchResultConfiguration.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.search;
-
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.extra.internal.extra.DomainEvent;
-import org.eclipse.dstore.extra.internal.extra.IDomainListener;
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-import org.eclipse.rse.services.search.AbstractSearchResultConfiguration;
-import org.eclipse.rse.services.search.IHostSearchResultSet;
-import org.eclipse.rse.services.search.ISearchService;
-
-public abstract class DStoreSearchResultConfiguration extends AbstractSearchResultConfiguration implements IDomainListener
-{
- protected DataElement _status;
- public DStoreSearchResultConfiguration(IHostSearchResultSet set, Object searchObject, SystemSearchString searchString, ISearchService searchService)
- {
- super(set, searchObject, searchString, searchService);
- }
-
- public void setStatusObject(DataElement status)
- {
- _status = status;
- // don't need this anymore
- //_status.getDataStore().getDomainNotifier().addDomainListener(this);
- }
-
- public DataElement getStatusObject()
- {
- return _status;
- }
-
- public boolean listeningTo(DomainEvent e)
- {
- return e.getParent() == _status;
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java
deleted file mode 100644
index cd0784057..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/search/DStoreSearchService.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.search;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.dstore.universal.miners.filesystem.UniversalFileSystemMiner;
-import org.eclipse.rse.services.clientserver.SystemSearchString;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.dstore.AbstractDStoreService;
-import org.eclipse.rse.services.dstore.ServiceResources;
-import org.eclipse.rse.services.dstore.files.DStoreHostFile;
-import org.eclipse.rse.services.files.IFileService;
-import org.eclipse.rse.services.search.IHostSearchConstants;
-import org.eclipse.rse.services.search.IHostSearchResultConfiguration;
-import org.eclipse.rse.services.search.ISearchService;
-
-
-
-public class DStoreSearchService extends AbstractDStoreService implements ISearchService
-{
- public DStoreSearchService(IDataStoreProvider provider, ISystemMessageProvider msgProvider)
- {
- super(provider, msgProvider);
- }
-
- public String getName()
- {
- return ServiceResources.DStore_Search_Service_Label;
- }
-
- protected String getMinerId()
- {
- return UniversalFileSystemMiner.MINER_ID;
- }
-
- public void search(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig, IFileService fileService)
- {
- DStoreHostFile searchTarget = (DStoreHostFile) searchConfig.getSearchTarget();
-
- SystemSearchString searchString = searchConfig.getSearchString();
- String textString = searchString.getTextString();
- boolean isCaseSensitive = searchString.isCaseSensitive();
- boolean isTextRegex = searchString.isTextStringRegex();
- String fileNamesString = searchString.getFileNamesString();
- boolean isFileNamesRegex = searchString.isFileNamesRegex();
- boolean includeArchives = searchString.isIncludeArchives();
- boolean includeSubfolders = searchString.isIncludeSubfolders();
- String classificationString = searchString.getClassificationString();
-
-
- DataElement deObj = searchTarget.getDataElement();
- DataStore ds = getDataStore();
-
- DataElement queryCmd = ds.localDescriptorQuery(deObj.getDescriptor(), "C_SEARCH"); //$NON-NLS-1$
-
- if (queryCmd != null)
- {
- ArrayList argList = setSearchAttributes(textString, isCaseSensitive, isTextRegex, fileNamesString, isFileNamesRegex, includeArchives, includeSubfolders, classificationString, true);
-
- DataElement status = ds.command(queryCmd, argList, deObj);
- DStoreSearchResultConfiguration config = (DStoreSearchResultConfiguration) searchConfig;
- config.setStatusObject(status);
-
- try
- {
- getStatusMonitor(ds).waitForUpdate(status, monitor);
- config.setStatus(IHostSearchConstants.FINISHED);
- }
- catch (Exception e)
- {
- config.setStatus(IHostSearchConstants.CANCELLED);
- }
- }
- }
-
- private ArrayList setSearchAttributes(
- String textString,
- boolean isCaseSensitive,
- boolean isTextRegex,
- String fileNamesString,
- boolean isFileNamesRegex,
- boolean includeArchives,
- boolean includeSubfolders,
- String classificationString,
- boolean showHidden)
- {
-
- DataStore ds = getDataStore();
- DataElement universaltemp = getMinerElement();
-
- // create the argument data elements
- DataElement arg1 = ds.createObject(universaltemp, textString, String.valueOf(isCaseSensitive), String.valueOf(isTextRegex));
- DataElement arg2 = ds.createObject(universaltemp, fileNamesString, String.valueOf(isFileNamesRegex), classificationString);
- DataElement arg3 = ds.createObject(universaltemp, String.valueOf(includeArchives), String.valueOf(includeSubfolders), String.valueOf(showHidden));
-
- // add the arguments to the argument list
- ArrayList argList = new ArrayList();
- argList.add(arg1);
- argList.add(arg2);
- argList.add(arg3);
-
- return argList;
- }
-
- public void cancelSearch(IProgressMonitor monitor, IHostSearchResultConfiguration searchConfig)
- {
- DStoreSearchResultConfiguration config = (DStoreSearchResultConfiguration) searchConfig;
- DataElement status = config.getStatusObject();
-
- if (status != null)
- {
- DataElement command = status.getParent();
- DataStore dataStore = command.getDataStore();
- DataElement cmdDescriptor = command.getDescriptor();
- DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); //$NON-NLS-1$
-
- if (cancelDescriptor != null)
- {
- dataStore.command(cancelDescriptor, command);
- }
- }
- }
-
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostOutput.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostOutput.java
deleted file mode 100644
index e369f6639..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostOutput.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed the initial implementation:
- * David McKnight.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.shells;
-
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.rse.services.shells.IHostOutput;
-
-public class DStoreHostOutput implements IHostOutput
-{
-
- private DataElement _element;
-
- public DStoreHostOutput(DataElement element)
- {
- _element = element;
- }
-
- public String getString()
- {
- return _element.getName();
- }
-
- public DataElement getElement()
- {
- return _element;
- }
-
- public String toString()
- {
- return getString();
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java
deleted file mode 100644
index 553fafaec..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreHostShell.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.shells;
-
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.rse.internal.services.dstore.shell.DStoreShellOutputReader;
-import org.eclipse.rse.internal.services.dstore.shell.DStoreShellThread;
-import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
-import org.eclipse.rse.services.shells.AbstractHostShell;
-import org.eclipse.rse.services.shells.IHostShell;
-import org.eclipse.rse.services.shells.IHostShellOutputReader;
-
-
-public class DStoreHostShell extends AbstractHostShell implements IHostShell
-{
- private DStoreShellThread _shellThread;
- private IHostShellOutputReader _stdoutHandler;
- private IHostShellOutputReader _stderrHandler;
- private DataElement _status;
- private DStoreStatusMonitor _statusMonitor;
-
- public DStoreHostShell(DStoreStatusMonitor statusMonitor, DataStore dataStore, String initialWorkingDirectory, String invocation, String encoding, String[] environment)
- {
- _shellThread = new DStoreShellThread(dataStore, initialWorkingDirectory, invocation, encoding, environment);
- _status = _shellThread.getStatus();
- _stdoutHandler = new DStoreShellOutputReader(this, _status, false);
- _stderrHandler = new DStoreShellOutputReader(this, _status,true);
- _statusMonitor = statusMonitor;
- }
-
- public boolean isActive()
- {
- return !_statusMonitor.determineStatusDone(_status);
- }
-
- public void writeToShell(String command)
- {
- _shellThread.writeToShell(command);
- }
-
- public IHostShellOutputReader getStandardOutputReader()
- {
- return _stdoutHandler;
- }
-
- public IHostShellOutputReader getStandardErrorReader()
- {
- return _stderrHandler;
- }
-
- public void exit()
- {
- writeToShell("exit"); //$NON-NLS-1$
- _stdoutHandler.finish();
- _stderrHandler.finish();
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java
deleted file mode 100644
index 70538dae0..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/shells/DStoreShellService.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.shells;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.IDataStoreProvider;
-import org.eclipse.rse.dstore.universal.miners.command.CommandMiner;
-import org.eclipse.rse.dstore.universal.miners.environment.EnvironmentMiner;
-import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.dstore.AbstractDStoreService;
-import org.eclipse.rse.services.dstore.ServiceResources;
-import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
-import org.eclipse.rse.services.shells.IHostShell;
-import org.eclipse.rse.services.shells.IShellService;
-
-
-public class DStoreShellService extends AbstractDStoreService implements IShellService
-{
- protected String[] _envVars;
- protected DataElement _envMinerElement;
- protected DataElement _envMinerStatus;
-
- public DStoreShellService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
- {
- super(dataStoreProvider, msgProvider);
- }
-
-
- public String getName()
- {
- return ServiceResources.DStore_Shell_Service_Label;
- }
-
- public String getDescription()
- {
- return ServiceResources.DStore_Shell_Service_Description;
- }
-
-
- public IHostShell launchShell(IProgressMonitor monitor, String initialWorkingDirectory, String[] environment)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
- return launchShell(monitor, initialWorkingDirectory, null, environment);
- }
-
- public IHostShell launchShell(IProgressMonitor monitor, String initialWorkingDirectory, String encoding, String[] environment)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
- return new DStoreHostShell(getStatusMonitor(getDataStore()), getDataStore(), initialWorkingDirectory, ">", encoding, environment); //$NON-NLS-1$
- }
-
- public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command,
- String[] environment)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
- return runCommand(monitor, initialWorkingDirectory, command, null, environment);
- }
-
- public IHostShell runCommand(IProgressMonitor monitor, String initialWorkingDirectory, String command,
- String encoding, String[] environment)
- {
- if (!isInitialized())
- {
- waitForInitialize(null);
- }
- return new DStoreHostShell(getStatusMonitor(getDataStore()), getDataStore(), initialWorkingDirectory, command, encoding, environment);
- }
-
- public String[] getHostEnvironment()
- {
- if (_envVars == null || _envVars.length == 0)
- {
- List envVars = new ArrayList();
- DataStore ds = getDataStore();
- DataElement envMinerData = ds.findMinerInformation(getEnvSystemMinerId());
- if (envMinerData != null)
- {
- DataElement systemEnvironment = ds.find(envMinerData, DE.A_NAME, "System Environment", 1); //$NON-NLS-1$
- if (systemEnvironment != null && systemEnvironment.getNestedSize() > 0)
- {
- for (int i = 0; i < systemEnvironment.getNestedSize(); i++)
- {
- DataElement var = systemEnvironment.get(i);
- envVars.add(var.getValue());
- }
- }
- }
- _envVars = (String[])envVars.toArray(new String[envVars.size()]);
- }
- return _envVars;
- }
-
- protected String getMinerId()
- {
- return CommandMiner.MINER_ID;
- }
-
- protected String getEnvSystemMinerId()
- {
- return EnvironmentMiner.MINER_ID;
- }
-
-
- public boolean isInitialized()
- {
- if (_initializeStatus != null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- return smon.determineStatusDone(_initializeStatus);
- }
- return false;
- }
-
- protected void waitForInitialize(IProgressMonitor monitor)
- {
- if (_envMinerStatus!= null)
- {
- DStoreStatusMonitor smon = getStatusMonitor(getDataStore());
- try
- {
- smon.waitForUpdate(_envMinerStatus, monitor);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- getMinerElement(getEnvSystemMinerId());
- }
- super.waitForInitialize(monitor);
- }
-
- public void uninitService(IProgressMonitor monitor)
- {
- super.uninitService(monitor);
-
- }
-
- protected void initMiner(IProgressMonitor monitor)
- {
- // init env miner first
-
- if (getServerVersion() >= 8)
- {
- String minerId = getEnvSystemMinerId();
- String message = SystemMessage.sub(ServiceResources.DStore_Service_ProgMon_Initializing_Message, "&1", minerId); //$NON-NLS-1$
- monitor.beginTask(message, IProgressMonitor.UNKNOWN);
- DataStore ds = getDataStore();
- if (_envMinerElement == null || _envMinerElement.getDataStore() != ds)
- {
- if (ds != null)
- {
- _envMinerStatus = ds.activateMiner(minerId);
- /*
- DStoreStatusMonitor smon = getStatusMonitor(ds);
- try
- {
- smon.waitForUpdate(status, monitor, 50);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
-
- getMinerElement(getEnvSystemMinerId());
- */
-
-
- }
- }
- super.initMiner(monitor);
- }
- }
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java
deleted file mode 100644
index 8afb7cc1f..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreFileTransferStatusListener.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.util;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.core.model.DataStoreSchema;
-import org.eclipse.rse.services.clientserver.IServiceConstants;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author mjberger
- *
- * copyright 2003 IBM Corp.
- */
-public class DStoreFileTransferStatusListener extends StatusChangeListener
-{
-
- protected String _remotePath;
- protected DataElement _log;
- protected DataElement _statusElement;
-
- public DStoreFileTransferStatusListener(String remotePath, Shell shell, IProgressMonitor monitor, DataStore ds, DataElement uploadLog) throws Exception
- {
- super(shell, monitor);
- _remotePath = remotePath.replace('\\', '/');
-
- _log = uploadLog;
- if (_log == null)
- {
- throw new Exception("Could not find log in DataStore."); //$NON-NLS-1$
- }
- setStatus(findOrCreateUploadStatus(ds));
- }
-
- protected DataElement findOrCreateUploadStatus(DataStore ds)
- {
- DataElement result = ds.find(_log, DE.A_NAME, _remotePath,1);
-
- // first upload, this will always ben null
- // but also need to handle case where it's been uploaded before in the sessoin (i.e. for reseting values)
- if (result == null)
- {
- result = _log.getDataStore().createObject(_log, "uploadstatus", _remotePath); //$NON-NLS-1$
- result.setAttribute(DE.A_SOURCE, "running"); //$NON-NLS-1$
- result.setAttribute(DE.A_VALUE, ""); //$NON-NLS-1$
-
- DataElement cmd = ds.findCommandDescriptor(DataStoreSchema.C_SET);
-
-// DataElement setstatus = ds.command(cmd, _log, true);
- ds.command(cmd, _log, true);
- /*
- try
- {
- StatusMonitorFactory.getInstance().getStatusMonitorFor(system, ds).waitForUpdate(setstatus);
- }
- catch (Exception e)
- {
- }
- */
- // DKM: no need for this - turns out the problem was that we need to send the LOG not the result -
- // since the server needs to know the parent!
- //ds.waitUntil(setstatus, "done");
-
- }
- else
- {
-
- result.setAttribute(DE.A_SOURCE, "running"); //$NON-NLS-1$
- result.setAttribute(DE.A_VALUE, ""); //$NON-NLS-1$
- }
- _statusElement = result;
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.rse.services.dstore.util.StatusChangeListener#determineStatusDone()
- */
- protected boolean determineStatusDone()
- {
- return getStatus().getAttribute(DE.A_SOURCE).equals(IServiceConstants.SUCCESS) || getStatus().getAttribute(DE.A_SOURCE).equals(IServiceConstants.FAILED);
-
- }
-
- public boolean uploadHasFailed()
- {
- return getStatus().getAttribute(DE.A_SOURCE).equals(IServiceConstants.FAILED);
- }
-
- public String getErrorMessage()
- {
- return getStatus().getAttribute(DE.A_VALUE);
- }
-
- public String getRemotePath()
- {
- return _remotePath;
- }
-
- public void setRemotePath(String remotePath)
- {
- _remotePath = remotePath;
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java
deleted file mode 100644
index 9576c4250..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.extra.internal.extra.DomainEvent;
-import org.eclipse.dstore.extra.internal.extra.IDomainListener;
-import org.eclipse.dstore.extra.internal.extra.IDomainNotifier;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-
-/*
- * This utility class can be used to monitor the status of one more more status DataElements.
- * Only one instanceof of this class is required per DataStore for use in monitoring statuses.
- * This is intended to be used in place of StatusChangeListeners
- *
- * * <p>
- * The following is one example of the use of the StatusMonitor. The code:
- * <blockquote><pre>
- * DataElement status = dataStore.command(dsCmd, args, deObj);
- *
- * StatusMonitor smon = StatusMonitorFactory.getInstance().getStatusMonitorFor(getSystem(), ds);
- * smon.waitForUpdate(status, monitor);
- * </pre></blockquote>
- */
-public class DStoreStatusMonitor implements IDomainListener
-{
-
- protected Shell _shell;
-
- protected boolean _networkDown = false;
-
- protected List _workingStatuses;
- protected List _cancelledStatuses;
- protected List _doneStatuses;
-
- protected DataStore _dataStore;
-
- protected class FindShell implements Runnable
- {
- private Shell shell;
-
- /**
- * @see Runnable#run()
- */
- public void run()
- {
- Display display = Display.getCurrent();
- if (display != null)
- {
- try {
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && shell == null; loop++) {
- if (shells[loop].isEnabled()) {
- shell = shells[loop];
- }
- }
- } catch (Exception e) {
- }
- }
- }
- }
-
- /**
- * Construct a StatusChangeListener
- *
- * @param dataStore the dataStore associated with this monitor
- */
- public DStoreStatusMonitor(DataStore dataStore)
- {
- _dataStore = dataStore;
- reInit();
- }
-
-
-
- public void reInit()
- {
- _networkDown = false;
- _workingStatuses = new ArrayList();
- _doneStatuses = new ArrayList();
- _cancelledStatuses = new ArrayList();
- if (_dataStore != null)
- {
- IDomainNotifier notifier = _dataStore.getDomainNotifier();
- if (notifier != null)
- {
- notifier.addDomainListener(this);
- }}
- }
-
- public DataStore getDataStore()
- {
- return _dataStore;
- }
-
- public void dispose()
- {
- _workingStatuses.clear();
- _doneStatuses.clear();
- _cancelledStatuses.clear();
- _dataStore.getDomainNotifier().removeDomainListener(this);
- }
-
- /**
- * @see IDomainListener#listeningTo(DomainEvent)
- */
- public boolean listeningTo(DomainEvent event)
- {
- if (_workingStatuses.size() == 0)
- {
- return true;
- }
-
- DataElement parent = (DataElement)event.getParent();
- if (_workingStatuses.contains(parent))
- {
- return determineStatusDone(parent);
- }
-
- return false;
- }
-
-
-
- /**
- * @see IDomainListener#domainChanged(DomainEvent)
- */
- public void domainChanged(DomainEvent event)
- {
- if (_workingStatuses.size() == 0)
- {
- return;
- }
-
- DataElement parent = (DataElement)event.getParent();
- if (_workingStatuses.contains(parent))
- {
- boolean isStatusDone = determineStatusDone(parent);
- if (isStatusDone)
- {
- setDone(parent);
- notifyUpdate();
- }
- }
- }
-
-
- /**
- * Determines whether the status is done.
- * @return <code>true</code> if status done, <code>false</code> otherwise.
- */
- public boolean determineStatusDone(DataElement status)
- {
- return status.getAttribute(DE.A_VALUE).equals("done") || status.getAttribute(DE.A_NAME).equals("done"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @return true if the the monitor is passive. In this case it is false.
- */
- public boolean isPassiveCommunicationsListener()
- {
- return false;
- }
-
- /**
- * setDone(boolean)
- */
- public synchronized void setDone(DataElement status)
- {
- _workingStatuses.remove(status);
- _doneStatuses.add(status);
- }
-
-
- public synchronized void setCancelled(DataElement status)
- {
- _workingStatuses.remove(status);
- _cancelledStatuses.add(status);
- }
-
- public synchronized void setWorking(DataElement status)
- {
- _workingStatuses.add(status);
- }
-
-
- public boolean wasCancelled(DataElement status)
- {
- if (_cancelledStatuses.contains(status))
- {
- return true;
- }
- return false;
- }
-
- /**
- * @see IDomainListener#getShell()
- */
- public Shell getShell()
- {
- // dy: DomainNotifier (which calls this method) requires the shell not be disposed
- //if (shell == null) {
- if (_shell == null || _shell.isDisposed())
- {
- FindShell findShell = new FindShell();
- Display.getDefault().syncExec(findShell);
- _shell = findShell.shell;
- }
- return _shell;
- }
-
-
-
- /**
- * Test if the StatusChangeListener returned because the network connection to the
- * remote system was broken.
- */
- public boolean isNetworkDown()
- {
- return _networkDown;
- }
-
- public DataElement waitForUpdate(DataElement status) throws InterruptedException
- {
- return waitForUpdate(status, null, 0);
- }
-
- public DataElement waitForUpdate(DataElement status, IProgressMonitor monitor) throws InterruptedException
- {
- return waitForUpdate(status, monitor, 0);
- }
-
- public DataElement waitForUpdate(DataElement status, int wait) throws InterruptedException
- {
- return waitForUpdate(status, null, wait);
- }
-
- public synchronized DataElement waitForUpdate(DataElement status, IProgressMonitor monitor, int wait) throws InterruptedException
- {
- if (_networkDown && status.getDataStore().isConnected())
- {
- reInit();
- }
- if (determineStatusDone(status))
- {
- setDone(status);
- return status;
- }
-
- setWorking(status);
-
- Display display = Display.getCurrent();
-
-
- // Prevent infinite looping by introducing a threshold for wait
- int WaitThreshold = 600; //default. sleep(100ms) for 600 times
- if ( wait > 0 )
- WaitThreshold = wait*10; // 1 second means 10 sleep(100ms)
- else if ( wait == -1 ) // force a diagnostic
- WaitThreshold = -1;
-
-
- if (display != null)
- {
- // Current thread is UI thread
- while (_workingStatuses.contains(status))
- {
- /*
- while (display.readAndDispatch()) {
- //Process everything on event queue
- }
-
- if ((monitor != null) && (monitor.isCanceled()))
- {
- setCancelled(status);
- throw new InterruptedException();
- }
- */
-
- boolean statusDone = determineStatusDone(status);
-
- if (statusDone)
- {
- setDone(status);
- }
- else
- {
- waitForUpdate();
- //Thread.sleep(100);
-
- if (WaitThreshold > 0) // update timer count if
- // threshold not reached
- --WaitThreshold; // decrement the timer count
-
- if (WaitThreshold == 0)
- {
- // no diagnostic factory but there is a timeout
- return status; // returning the undone status object
- }
- else if (_networkDown)
- {
- dispose();
- throw new InterruptedException();
- }
- }
- }
-
- }
- else
- {
- // Current thread is not UI thread
- while (_workingStatuses.contains(status))
- {
- boolean statusDone = determineStatusDone(status);
- if (statusDone)
- {
- setDone(status);
- }
- else
- {
- if ((monitor != null) && (monitor.isCanceled()))
- {
- setCancelled(status);
- throw new InterruptedException();
- }
-
- waitForUpdate();
- //Thread.sleep(200);
-
- if (WaitThreshold > 0) // update timer count if
- // threshold not reached
- --WaitThreshold; // decrement the timer count
-
- if (WaitThreshold == 0)
- {
- // no diagnostic factory but there is a timeout
- return status; // returning the undone status object
- }
- else if (_networkDown)
- {
- dispose();
- throw new InterruptedException();
- }
- }
- }
- }
-
-
- return status;
- }
-
-
- /**
- * Causes the current thread to wait until this class request has been
- * fulfilled.
- */
- public synchronized void waitForUpdate()
- {
- try
- {
- wait(200);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- return;
- }
- }
-
- /**
- * Causes all threads waiting for this class request to be filled
- * to wake up.
- */
- public synchronized void notifyUpdate()
- {
- notifyAll();
- }
-
-
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java
deleted file mode 100644
index ea7a79c99..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.util;
-
-
-
-import java.io.File;
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.core.model.DataStore;
-import org.eclipse.dstore.extra.internal.extra.DomainEvent;
-import org.eclipse.dstore.extra.internal.extra.IDomainListener;
-import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.services.dstore.ServiceResources;
-import org.eclipse.swt.widgets.Display;
-
-public class DownloadListener implements IDomainListener,IUniversalDataStoreConstants
-{
-
- private DataElement _status;
- private IProgressMonitor _monitor;
- private DataStore _dataStore;
- private File _localFile;
- private Display _display;
-
- private boolean _networkDown = false;
- private boolean _isDone = false;
- private boolean _isCancelled = false;
- private long _totalBytesNotified = 0;
- private long _totalLength;
-
- private static String _percentMsg = SystemMessage.sub(SystemMessage.sub(SystemMessage.sub(ServiceResources.DStore_Service_Percent_Complete_Message, "&0", "{0}"), "&1", "{1}"), "&2", "{2}"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
- public DownloadListener(IProgressMonitor monitor, DataElement status, File localFile, String remotePath, long totalLength)
- {
- _monitor = monitor;
- _status = status;
- _totalLength = totalLength;
- _display = Display.getCurrent();
-
- if (_status == null)
- {
- System.out.println("Status is null!"); //$NON-NLS-1$
- }
-
- _dataStore = _status.getDataStore();
- _dataStore.getDomainNotifier().addDomainListener(this);
-
- _localFile = localFile;
-
- if (monitor != null)
- {
- /* DKM - DO WE NEED THIS?!!
- while (_display!=null && _display.readAndDispatch()) {
- //Process everything on event queue
- }
- */
- }
- if (_status.getValue().equals("done")) //$NON-NLS-1$
- {
- updateDownloadState();
- setDone(true);
- }
-
- }
- public boolean isCancelled()
- {
- return _isCancelled;
- }
-
- public DataElement getStatus()
- {
- return _status;
- }
-
- /**
- * @see IDomainListener#listeningTo(DomainEvent)
- */
- public boolean listeningTo(DomainEvent event)
- {
- if (_status == null)
- {
- return false;
- }
-
- if (_status == event.getParent())
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * @see IDomainListener#domainChanged(DomainEvent)
- */
- public void domainChanged(DomainEvent event)
- {
- if (_status.getValue().equals("done")) //$NON-NLS-1$
- {
- if (_status == event.getParent())
- {
- setDone(true);
- }
- }
- else
- {
- updateDownloadState();
- }
- }
-
- private void updateDownloadState()
- {
-
- if (_monitor != null)
- {
- long currentLength = _localFile.length();
- long delta = currentLength - _totalBytesNotified;
- if (delta > 0)
- {
- //System.out.println(_status.getAttribute(DE.A_SOURCE));
- _monitor.worked((int)delta);
-
- try
- {
- long percent = (currentLength * 100) / _totalLength;
-
-
- StringBuffer current = new StringBuffer();
- current.append(currentLength /KB_IN_BYTES);
- current.append(" KB"); //$NON-NLS-1$
-
- StringBuffer total = new StringBuffer();
- total.append(_totalLength / KB_IN_BYTES);
- total.append(" KB"); //$NON-NLS-1$
-
- StringBuffer percentBuf = new StringBuffer();
- percentBuf.append(percent);
- percentBuf.append("%"); //$NON-NLS-1$
-
- String str = MessageFormat.format(_percentMsg, new Object[] {current, total, percentBuf});
-
- _monitor.subTask(str);
-
- /* DKM - DO WE NEED THIS?!!
- while (_display != null && _display.readAndDispatch()) {
- //Process everything on event queue
- }
- */
- }
- catch (Exception e)
- {
- }
- _totalBytesNotified = currentLength;
- }
- }
-
- if (!_status.getDataStore().getStatus().getName().equals("okay")) //$NON-NLS-1$
- {
- _networkDown = true;
- }
- }
-
- /**
- * setDone(boolean)
- */
- public void setDone(boolean done)
- {
- this._isDone = done;
- if (done)
- {
- updateDownloadState();
- _status.getDataStore().getDomainNotifier().removeDomainListener(this);
-
- }
- }
-
-
-
- /**
- *
- */
- public boolean wasCancelled()
- {
- return _isCancelled;
- }
-
-
-
- /**
- * Wait for the the status DataElement to be refreshed
- *
- * @param
- * ICommunicationsDiagnosticFactory factory : for creating system specific diagnostic class instance
- * Int wait : threshold for starting diagnostic. Default is 60 seconds; a zero means to use the default.
- * -1 means to force a timeout; mainly for testing purpose.
- *
- * @return The status DataElement after it has been updated, or the user
- * has pressed cancel
- *
- * @throws InterruptedException if the thread was interrupted.
- */
- public DataElement waitForUpdate() throws InterruptedException
- {
- return waitForUpdate(0); //No diagnostic
- }
-
-
- public DataElement waitForUpdate(int wait) throws InterruptedException
- {
- Display display = _display;
-
- if (wait > 0)
- {
- }
- else if (wait == -1)
- {
- }
-
-
-
- if (display != null)
- {
-
- // Current thread is UI thread
- while (!_isDone && !_isCancelled && !_networkDown)
- {
- while (display.readAndDispatch()) {
- //Process everything on event queue
- }
-
- if ((_monitor != null) && (_monitor.isCanceled()))
- {
- // cancel remote request
- cancelDownload();
- _isCancelled = true;
- setDone(true);
- }
- else if (_networkDown)
- {
- _isCancelled = true;
- setDone(true);
- throw new InterruptedException();
- }
-
- if (getStatus().getAttribute(DE.A_NAME).equals("done")) //$NON-NLS-1$
- {
- setDone(true);
- }
- else
- {
- Thread.sleep(100);
- updateDownloadState();
- }
- }
-
- }
- else
- {
- // Current thread is not UI thread
- while (!_isDone && !_isCancelled && !_networkDown)
- {
- if ((_monitor != null) && (_monitor.isCanceled()))
- {
- cancelDownload();
- _isCancelled = true;
- setDone(true);
- }
- else if (_networkDown)
- {
- _isCancelled = true;
- setDone(true);
- throw new InterruptedException();
- }
- if (getStatus().getAttribute(DE.A_NAME).equals("done")) //$NON-NLS-1$
- {
- setDone(true);
- }
- else
- {
- Thread.sleep(100);
- updateDownloadState();
- }
- }
- }
- return _status;
- }
-
- public void cancelDownload()
- {
- DataElement status = _status;
- if (status != null)
- {
- DataElement command = status.getParent();
- DataStore dataStore = command.getDataStore();
- DataElement cmdDescriptor = command.getDescriptor();
- DataElement cancelDescriptor = dataStore.localDescriptorQuery(cmdDescriptor, "C_CANCEL"); //$NON-NLS-1$
- if (cancelDescriptor != null)
- {
- dataStore.command(cancelDescriptor, command);
- }
- _localFile.delete();
- }
- if (_monitor != null)
- {
- _monitor.done();
- }
- }
-} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java
deleted file mode 100644
index c7f036f0a..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/FileSystemMessageUtil.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.rse.services.dstore.util;
-
-import org.eclipse.dstore.core.model.DataElement;
-
-public class FileSystemMessageUtil
-{
-
- /**
- * Returns the source message (first part of the source attribute) for this element.
- *
- * @return the source message
- */
- public static String getSourceMessage(DataElement element)
- {
- String source = element.getSource();
- if (source == null) return null;
- if (source.equals("")) return ""; //$NON-NLS-1$ //$NON-NLS-2$
- int sepIndex = source.indexOf("|"); //$NON-NLS-1$
- if (sepIndex == -1) return source;
- else return source.substring(0, sepIndex);
- }
-
- /**
- * Returns the source location (second part of the source attribute) for this element.
- *
- * @return the source location
- */
- public static String getSourceLocation(DataElement element)
- {
- String source = element.getSource();
- if (source == null) return null;
- if (source.equals("")) return ""; //$NON-NLS-1$ //$NON-NLS-2$
- int sepIndex = source.indexOf("|"); //$NON-NLS-1$
- if (sepIndex == -1) return ""; //$NON-NLS-1$
- else return source.substring(sepIndex+1);
- }
-}
diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java
deleted file mode 100644
index 03313728e..000000000
--- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/StatusChangeListener.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006 IBM Corporation. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.services.dstore.util;
-
-
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.dstore.core.model.DE;
-import org.eclipse.dstore.core.model.DataElement;
-import org.eclipse.dstore.extra.internal.extra.DomainEvent;
-import org.eclipse.dstore.extra.internal.extra.IDomainListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/*
- * Utility class for determining when a DataStore command is complete via the status.
- */
-public class StatusChangeListener implements IDomainListener
-{
-
- protected DataElement target;
- protected Shell shell;
- protected IProgressMonitor monitor;
-
- protected boolean _networkDown = false;
- protected boolean done = false;
- protected boolean cancelled = false;
-
- protected Vector historyOfTargets;
-
- protected static class FindShell implements Runnable {
- private Shell shell;
-
- /**
- * @see Runnable#run()
- */
- public void run() {
- try {
- Shell[] shells = Display.getCurrent().getShells();
- for (int loop = 0; loop < shells.length && shell == null; loop++) {
- if (shells[loop].isEnabled()) {
- shell = shells[loop];
- }
- }
- } catch (Exception e) {
- }
- }
- }
-
-
- /**
- * Construct a StatusChangeListener
- *
- * @param shell A valid Shell object
- *
- * @param monitor A progress monitor if you want this object to check if
- * the user presses cancel while waiting for the status object
- * to be updated
- *
- * @param target The status DataElement for which you wish to wait for an update
- */
- public StatusChangeListener(Shell shell, IProgressMonitor monitor, DataElement target) {
- this.shell = shell;
- this.monitor = monitor;
- this.target = target;
- historyOfTargets = new Vector();
- }
-
-
- public StatusChangeListener(Shell shell, IProgressMonitor monitor) {
- this(shell, monitor, null);
- }
-
-
-// public StatusChangeListener(Shell shell, DataElement target) {
-// this(shell, null, target);
-// }
-
-
- /**
- *
- */
- public void setStatus(DataElement p_target)
- {
- this.target = p_target;
-
- for (int i = 0; i < historyOfTargets.size(); i++)
- {
- if (target == historyOfTargets.elementAt(i))
- {
- setDone( true );
- historyOfTargets.clear();
- return;
- }
- }
-
- historyOfTargets.clear();
- }
-
- /**
- *
- */
- public DataElement getStatus()
- {
- return target;
- }
-
- /**
- * @see IDomainListener#listeningTo(DomainEvent)
- */
- public boolean listeningTo(DomainEvent event) {
- if (target == null)
- {
- return true;
- }
-
- if (target == event.getParent()) {
- return true;
- }
-
- return false;
- }
-
-
- /**
- * @see IDomainListener#domainChanged(DomainEvent)
- */
- public void domainChanged(DomainEvent event) {
- if (target == null)
- {
- if (historyOfTargets.size() < 1000)
- {
- historyOfTargets.addElement(event.getParent());
- }
- }
-
- if (target == event.getParent())
- {
- boolean isStatusDone = determineStatusDone();
-
- if (isStatusDone)
- {
- setDone( true );
- }
- }
- }
-
-
- /**
- * setDone(boolean)
- */
- public void setDone(boolean done)
- {
- this.done = done;
- }
-
- public Shell getShell() {
- // dy: DomainNotifier (which calls this method) requires the shell not be disposed
- //if (shell == null) {
- if (shell == null || shell.isDisposed())
- {
- FindShell findShell = new FindShell();
- Display.getDefault().syncExec(findShell);
- shell = findShell.shell;
- }
- return shell;
- }
-
- /**
- *
- */
- public boolean wasCancelled() {
- return cancelled;
- }
-
-
-
-
- /**
- * Wait for the the status DataElement to be refreshed
- *
- * @param
- * ICommunicationsDiagnosticFactory factory : for creating system specific diagnostic class instance
- * Int wait : threshold for starting diagnostic. Default is 60 seconds; a zero means to use the default.
- * -1 means to force a timeout; mainly for testing purpose.
- *
- * @return The status DataElement after it has been updated, or the user
- * has pressed cancel
- *
- * @throws InterruptedException if the thread was interrupted.
- */
- public DataElement waitForUpdate() throws InterruptedException
- {
- return waitForUpdate( 0); //No diagnostic
- }
-
-
- public DataElement waitForUpdate(int wait) throws InterruptedException
- {
- boolean statusDone = determineStatusDone();
- if (statusDone)
- {
- setDone(true);
- }
- else
- {
- Display display = Display.getCurrent();
-
- if ( wait > 0 )
- {
- }
- else if ( wait == -1 )
- {
- }
-
-
- if (display != null) {
- if (shell == null || shell.isDisposed()) {
- shell = Display.getDefault().getActiveShell();
- }
- // Current thread is UI thread
- while (!done && !cancelled) {
- while (display.readAndDispatch()) {
- //Process everything on event queue
- }
-
- if ((monitor != null) && (monitor.isCanceled())) {
- cancelled = true;
- target.getDataStore().getDomainNotifier().removeDomainListener(this);
- throw new InterruptedException();
- }
-
- statusDone = determineStatusDone();
-
- if (statusDone)
- {
- setDone(true);
- }
- else
- {
- Thread.sleep(100);
- if (_networkDown)
- {
- target.getDataStore().getDomainNotifier().removeDomainListener(this);
- throw new InterruptedException();
- }
- }
- }
-
- } else {
- // Current thread is not UI thread
- while (!done && !cancelled)
- {
-
- if ((monitor != null) && (monitor.isCanceled()))
- {
- cancelled = true;
- target.getDataStore().getDomainNotifier().removeDomainListener(this);
- throw new InterruptedException();
- }
-
- statusDone = determineStatusDone();
-
- if (statusDone)
- {
- setDone(true);
- }
- else {
- Thread.sleep(100);
-
- if (_networkDown)
- {
- target.getDataStore().getDomainNotifier().removeDomainListener(this);
- throw new InterruptedException();
- }
- }
- }
- }
- }
-
- // Reset done so we can detect the next event if waitForUpdate
- // is called again
- done = false;
-
- return target;
- }
-
- /**
- * Determines whether the status is done.
- * @return <code>true</code> if status done, <code>false</code> otherwise.
- */
- protected boolean determineStatusDone() {
- return getStatus().getAttribute(DE.A_VALUE).equals("done") || getStatus().getAttribute(DE.A_NAME).equals("done"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @see org.eclipse.rse.core.subsystems.ICommunicationsListener#isPassiveCommunicationsListener()
- */
- public boolean isPassiveCommunicationsListener() {
- return false;
- }
-
-
- /**
- * Test if the StatusChangeListener returned because the network connection to the
- * remote system was broken.
- */
- public boolean isNetworkDown() {
- return _networkDown;
- }
-} \ No newline at end of file

Back to the top