Remote System Explorer DataStore
Release 3.4

org.eclipse.dstore.core.model
Class DataStore

java.lang.Object
  extended by org.eclipse.dstore.core.model.DataStore

public final class DataStore
extends Object

DataStore is the heart of the DataStore Distributed Tooling Framework. This class is used for creating, deleting and accessing DataElements and for communicating commands to miners (tools).

Every DataStore has both a command handler and an update handler. The command handler is responsible for sending commands, in the form of DataElement trees, to the appropriate implementer, either directly to the miner, or indirectly over the communication layer through a server DataStore. The update handler is responsible for notifying listeners about changes in the DataStore, either directly via a IDomainNotifier or indirectly over the communication layer through a client DataStore.


Field Summary
static String JARFILE_EXTENSION
           
static String REMOTE_CLASS_CACHE_JARFILE_NAME
           
static int SPIRIT_ON_INITIAL_SIZE
           
 
Constructor Summary
DataStore(DataStoreAttributes attributes)
          Creates a new DataStore instance
DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, IDomainNotifier domainNotifier)
          Creates a new DataStore instance
DataStore(DataStoreAttributes attributes, CommandHandler commandHandler, UpdateHandler updateHandler, IDomainNotifier domainNotifier, int initialSize)
          Creates a new DataStore instance
DataStore(DataStoreAttributes attributes, int initialSize)
          Creates a new DataStore instance
 
Method Summary
 DataElement activateMiner(String minerId)
          Used to load and initialize a new miner on the host
 void addDataStorePreferenceListener(IDataStorePreferenceListener listener)
          Adds a preference change listener to the DataStore
 void addLoader(IExternalLoader loader)
          Adds a loader for this DataStore.
 void addMinersLocation(DataElement location)
          Tells the DataStore where to find the miners which it needs to load.
 DataElement addMinersLocation(String minersLocation)
          Tells the DataStore where to find the miners which it needs to load.
 void addToRecycled(DataElement toRecycle)
           
 void appendToFile(String remotePath, byte[] buffer, int size, boolean binary)
          Append a file to the specified location
 void appendToFile(String remotePath, byte[] buffer, int size, boolean binary, String byteStreamHandlerId)
          Append a file to the specified location
protected  void assignCacheJar()
           
 void cacheClass(String className, byte[] bytes, int size)
          Saves a class to disk (caches it) so that it can be loaded by the classloader without needing to download it again
 void cancelAllCommands()
          Tells the command handler to cancel all pending commands.
 void cleanBadReferences(DataElement root)
           
 DataElement command(DataElement commandObject)
          Issues a command.
 DataElement command(DataElement commandDescriptor, ArrayList arguments, DataElement dataObject)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, ArrayList arguments, DataElement dataObject, boolean immediate)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, DataElement dataObject)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, DataElement dataObject, boolean noRef)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, DataElement dataObject, boolean noRef, boolean immediate)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, DataElement arg, DataElement dataObject)
          Creates and issues a command.
 DataElement command(DataElement commandDescriptor, DataElement arg, DataElement dataObject, boolean immediate)
          Creates and issues a command.
 boolean contains(String id)
          Checks if a DataElement with a given ID exists in the DataStore
 DataElement createAbstractCommandDescriptor(DataElement parent, String name)
          Creates a new abstract command descriptor DataElement
 DataElement createAbstractCommandDescriptor(DataElement parent, String name, String value)
          Creates a new abstract command descriptor DataElement
 DataElement createAbstractCommandDescriptor(DataElement parent, String name, String source, String value)
          Creates a new abstract command descriptor DataElement
 DataElement createAbstractObjectDescriptor(DataElement parent, String name)
          Creates a new abstract object descriptor DataElement
 DataElement createAbstractObjectDescriptor(DataElement parent, String name, String source)
          Creates a new abstract object descriptor DataElement
 DataElement createAbstractRelationDescriptor(DataElement parent, String name)
          Creates a new abstract relation descriptor DataElement
 DataElement createAbstractRelationDescriptor(DataElement parent, String name, String source)
          Creates a new abstract relation descriptor DataElement
 DataElement createCommandDescriptor(DataElement parent, String name)
          Creates a new command descriptor DataElement
 DataElement createCommandDescriptor(DataElement parent, String name, String value)
          Creates a new command descriptor DataElement
 DataElement createCommandDescriptor(DataElement parent, String name, String source, String value)
          Creates a new command descriptor DataElement
 DataElement createCommandDescriptor(DataElement parent, String name, String source, String value, boolean visible)
          Creates a new command descriptor DataElement
protected  JarOutputStream createNewCacheJar(File newJar)
           
 DataElement createObject(DataElement parent, DataElement type, String name)
          Creates a new DataElement
 DataElement createObject(DataElement parent, DataElement type, String name, String source)
          Creates a new DataElement
 DataElement createObject(DataElement parent, DataElement type, String name, String source, String sugId)
          Creates a new DataElement
 DataElement createObject(DataElement parent, DataElement type, String name, String source, String sugId, boolean isReference)
          Creates a new DataElement
 DataElement createObject(DataElement parent, String[] attributes)
          Creates a new DataElement.
 DataElement createObject(DataElement parent, String type, String name)
          Creates a new DataElement
 DataElement createObject(DataElement parent, String type, String name, String source)
          Creates a new DataElement
 DataElement createObject(DataElement parent, String type, String name, String source, String sugId)
          Creates a new DataElement
 DataElement createObject(DataElement parent, String type, String name, String source, String sugId, boolean isReference)
          Creates a new DataElement
 DataElement createObjectDescriptor(DataElement parent, String name)
          Creates a new object descriptor DataElement
 DataElement createObjectDescriptor(DataElement parent, String name, String source)
          Creates a new object descriptor DataElement
 DataElement createReference(DataElement from, DataElement to)
          Creates a contents relationship between two DataElements
 DataElement createReference(DataElement parent, DataElement realObject, DataElement relationType)
          Creates a relationship between two DataElements given a type of relationship
 DataElement createReference(DataElement parent, DataElement realObject, DataElement toRelation, DataElement fromRelation)
          Creates a two-way relationship between two elements
 DataElement createReference(DataElement parent, DataElement realObject, String relationType)
          Creates a relationship between two DataElements given a type of relationship
 DataElement createReference(DataElement parent, DataElement realObject, String relationType, boolean doRefresh)
          Creates a relationship between two DataElements given a type of relationship
 DataElement createReference(DataElement parent, DataElement realObject, String toRelation, String fromRelation)
          Creates a two-way relationship between two elements
 void createReferences(DataElement from, ArrayList to, DataElement type)
          Creates a set of relationships between one DataElement and a set of DataElements given a type of relationship
 void createReferences(DataElement from, ArrayList to, DataElement toRel, DataElement fromRel)
          Creates a set of two-way relationship between a DataElement and a list of elements
 void createReferences(DataElement from, ArrayList to, String type)
          Creates a set of relationships between one DataElement and a set of DataElements given a type of relationship
 void createReferences(DataElement from, ArrayList to, String toRel, String fromRel)
          Creates a set of two-way relationship between a DataElement and a list of elements
 DataElement createRelationDescriptor(DataElement parent, String name)
          Creates a new relation descriptor DataElement
 DataElement createRelationDescriptor(DataElement parent, String name, String source)
          Creates a new relation descriptor DataElement
 void createRoot()
          Initializes the DataStore by creating the root elements
 DataElement createTicket(String ticketStr)
           
 DataElement createTransientObject(String[] attributes)
           
 void deleteObject(DataElement from, DataElement toDelete)
          Deletes an element from another element
 void deleteObjects(DataElement from)
          Deletes all the elements contained in from
 void disconnectObject(DataElement toDisconnect)
          Disconnects an element and makes it a "spirit"
 void disconnectObjects(DataElement from)
          Disconnect all the elements contained in from
 void enableAutoRefresh(boolean flag)
           
 boolean filter(ArrayList descriptors, DataElement dataElement)
          Indicate whether a given set of descriptors can contain the specified element
 boolean filter(DataElement descriptor, DataElement dataElement)
          Indicate whether a given descriptor can contain the specified element
 boolean filter(DataElement descriptor, DataElement dataElement, int depth)
          Indicate whether a given descriptor can contain the specified element
 DataElement find(DataElement root, int attribute, String name)
          Finds an element matching a specified attribute and name.
 DataElement find(DataElement root, int attribute, String name, int depth)
          Finds an element matching a specified attribute and name.
 DataElement find(String id)
          Finds an element with the specified ID.
 DataElement findCommandDescriptor(String name)
          Finds an command descriptor element with a specified name.
 List findDeleted(DataElement root)
          Finds all the deleted elements
 List findDeleted(DataElement root, int depth)
          Finds all the deleted elements
 DataElement findDescriptor(String type, String name)
          Finds a descriptor element with a specified type and name.
 DataElement findMinerInformation(String minerName)
          Returns the element that represents the specified miner's data.
 DataElement findObjectDescriptor(String name)
          Finds an object descriptor element with a specified name.
 List findObjectsOfType(DataElement root, DataElement type)
          Finds all the elements that are of a given type from a specified element.
 List findObjectsOfType(DataElement root, String type)
          Finds all the elements that are of a given type from a specified element.
 DataElement findRelationDescriptor(String name)
          Finds an relation descriptor element with a specified name.
 void finish()
           
 void flush()
          Delete information from the DataStore.
 void flush(DataElement element)
          Delete information from the DataStore contained by an element.
protected  String generateId()
          Generates a new unique ID to be used by a DataElement
 DataElement getAbstractedByRelation()
           
 DataElement getAbstractsRelation()
           
 String getAttribute(int attribute)
          Returns the attribute indicated by an index.
 DataElement getAttributesRelation()
           
 IByteConverter getByteConverter()
           
 IByteStreamHandler getByteStreamHandler(String id)
           
protected  String getCacheDirectory()
           
 IClassByteStreamHandler getClassByteStreamHandler(String id)
           
 HashMap getClassRequestRepository()
           
 Client getClient()
          This method is used to get the object of the Client stored for each user.
 CommandHandler getCommandHandler()
          Returns the handler for sending commands.
 int getCommandWaitTime()
          Returns the time the command handler waits between requests
 IDataStoreCompatibilityHandler getCompatibilityHandler()
          Get the compatibility handler for the client.
 DataElement getContentsRelation()
           
 IByteStreamHandler getDefaultByteStreamHandler()
           
 IClassByteStreamHandler getDefaultClassByteStreamHandler()
           
 DataElement getDescriptorRoot()
          Returns the descriptor root DataElement of the DataStore.
 IDomainNotifier getDomainNotifier()
          Returns the domain notifier.
 DataElement getDummy()
           
 DataElement getExternalRoot()
           
 HashMap getHashMap()
          Returns the table of live elements in the DataStore.
 DataElement getHostRoot()
          Returns the host root DataElement in the DataStore.
 String getKeyStoreLocation()
           
 String getKeyStorePassword()
           
 List getLastCreatedElements()
           
 ArrayList getLoaders()
          Returns the loader that is used for loading miners.
 ArrayList getLocalClassLoaders()
          Returns registered local classloaders.
 DataElement getLogRoot()
          Returns the log root DataElement of the DataStore.
 DataElement getMinerFor(DataElement commandDescriptor)
          Finds the element that represents the miner that implements a particular command.
 DataElement getMinerRoot()
          Returns the miner root DataElement in the DataStore.
 ArrayList getMinersLocation()
          Returns the location of the miners.
 String getName()
          Returns the name of the DataStore
 int getNumElements()
          Returns the number of live elements in the DataStore.
 int getNumRecycled()
          Returns the number of recycled elements in the DataStore.
 String getPreference(String property)
           
 String getReferenceTag()
           
 ArrayList getRelationItems(DataElement descriptor, String fixateOn)
          Finds all relationship descriptor types that can be applied to a particular element.
 RemoteClassLoader getRemoteClassLoader()
           
 File getRemoteClassLoaderCache()
           
 String getRemoteIP()
           
 DataElement getRoot()
          Returns the root DataElement in the DataStore.
 DataElement getSchema()
          Used at DataStore initialization time to setup the schema
 int getServerIdleShutdownTimeout()
          Gets the time the server may remain idle before shutting down
 int getServerMinor()
           
 int getServerVersion()
           
 DataElement getStatus()
          Returns the status of the DataStore.
 DataElement getTempRoot()
          Returns the temp root DataElement of the DataStore.
 DataElement getTicket()
          Returns the DataStore's ticket
 int getTimeoutValue()
           
 UpdateHandler getUpdateHandler()
          Returns the handler for doing updates.
 int getUpdateWaitTime()
          Returns the time the update handler waits between requests
 String getUserPreferencesDirectory()
          getUserPreferencesDirectory() - returns directory on IFS where to store user settings
 DataElement initMiners()
          Used at DataStore initialization time to initialize the miners
 boolean isAutoRefreshOn()
           
 boolean isConnected()
          Indicates whether this DataStore is connected to it's miners or another DataStore
 boolean isDoSpirit()
           
 boolean isTransient(DataElement commandObject)
          Indicate whether an command is specified as transient
 boolean isVirtual()
          Indicates whether this DataStore is virtual or not.
 boolean isWaiting(DataElement status)
           
 void load(DataElement root, String pathName)
          Load a persisted DataStore tree into the specified DataElement
static FileInputStream loadFile(String fileName)
           
 DataElement localDescriptorQuery(DataElement object, String keyName)
          Find a command descriptor element in the schema with the given value.
 DataElement localDescriptorQuery(DataElement descriptor, String keyName, int depth)
          Find a command descriptor element in the schema with the given value.
 boolean logTimes()
          Indicates whether this DataStore logs the durations of commands
 String mapToLocalPath(String aPath)
          Get the mapping from a remote path to a local path.
 void memLog(String str)
           
 void modifyObject(DataElement localObject)
           
 void moveObject(DataElement source, DataElement target)
          Moves a element from one location in the DataStore tree to another
 int printTree(String indent, DataElement root)
           
 int printTree(String indent, int number, DataElement root)
           
 DataElement queryClientIP()
           
 DataElement queryHostJVM()
           
 DataElement queryInstall()
           
 boolean queryServerSpiritState()
           
 DataElement queryShowTicket(DataElement ticket)
           
 void receiveStartSpiritCommand()
           
 void refresh(ArrayList elements)
          Refresh a set of DataElements
 void refresh(DataElement element)
          Refresh a DataElement
 void refresh(DataElement element, boolean immediate)
          Refresh a DataElement - immediately if indicated
 void refresh(DataElement element, int depth, boolean immediate)
          Refresh a DataElement and its children to a certain depth - immediately if indicated
 void registerByteStreamHandler(IByteStreamHandler handler)
          Registers a byte stream handler.
 void registerClassByteStreamHandler(IClassByteStreamHandler handler)
          Registers a class byte stream handler.
 void registerLocalClassLoader(ClassLoader loader)
          Registers a local class loader.
 void removeAllDataStorePreferenceListeners()
          Removes all the preference change listeners
 void removeDataStorePreferenceListener(IDataStorePreferenceListener listener)
          Removes a specific preference change listener from the Datastore
 void replaceAppendFile(String remotePath, byte[] bytes, int size, boolean binary)
          Transfers a file from a client to a server.
 void replaceAppendFile(String remotePath, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Transfers a file from a client to a server.
 DataElement replaceDeleted(DataElement deletedObject)
          Replaces a deleted object
 void replaceFile(String remotePath, byte[] bytes, int size, boolean binary)
          Transfers a file from a client to a server.
 void replaceFile(String remotePath, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Transfers a file from a client to a server.
 void requestClass(String className)
          On the server, sends a class request through the ServerUpdateHandler to the client.
 void runRemoteClassInstance(IRemoteClassInstance runnable)
           
 void saveClass(String className, byte[] buffer, int size)
          Saves a class to memory (but not to disk) where it can then be loaded by the RemoteClassLoaders.
 void saveClass(String className, byte[] buffer, int size, String classbyteStreamHandlerId)
          Saves a class to memory (but not to disk) where it can then be loaded by the RemoteClassLoaders.
 void saveClassInstance(byte[] buffer, int size, String classbyteStreamHandlerId)
          Saves a class instance
 void saveFile(DataElement root, String remotePath, int depth)
          Persist the DataStore tree from a given root
 void saveFile(String remotePath, byte[] buffer, int size, boolean binary)
          Save a file in the specified location
 void saveFile(String remotePath, byte[] buffer, int size, boolean binary, String byteStreamHandlerId)
          Save a file in the specified location
 ArrayList searchForPattern(DataElement root, ArrayList attributes, ArrayList patterns, boolean ignoreCase)
          Find all elements from a given element that match a certain set of attributes.
 ArrayList searchForPattern(DataElement root, int[] attributes, String[] patterns, int numAttributes, boolean ignoreCase)
          Find all elements from a given element that match a certain set of attributes.
 ArrayList searchForPattern(DataElement root, int[] attributes, String[] patterns, int numAttributes, boolean ignoreCase, int depth)
          Find all elements from a given element that match a certain set of attributes.
 ArrayList searchForPattern(DataElement root, int[] attributes, String[] patterns, int numAttributes, boolean ignoreCase, int depth, ArrayList searched)
          Find all elements from a given element that match a certain set of attributes.
 ArrayList searchForPattern(DataElement root, int attribute, String pattern, boolean ignoreCase)
          Find all elements from a given element that match a certain attribute.
 void sendClass(String className)
          On the server, sends a class through the ServerCommandHandler to the client.
 void sendKeepAliveConfirmation()
           
 void sendKeepAliveRequest()
          On the server, sends a keepalive request through the ServerUpdateHandler to the client.
 void setAttribute(int attribute, String value)
          Sets an attribute of the DataStore
 void setByteConverter(IByteConverter converter)
           
 void setClient(Client client)
          This method is used to set the Client object for each user.
 void setCommandHandler(CommandHandler commandHandler)
          Sets the DataStore's handler for sending commands to miners
 void setCommandWaitTime(int time)
          Sets the time the command handler sleeps in between command requests
 void setCompatibilityHandler(IDataStoreCompatibilityHandler handler)
          Set the compatibility handler for the client.
 void setConnected(boolean isConnected)
          Tells the DataStore that it is connected to it's tools
 void setDefaultByteStreamHandler()
          Sets the current ByteStreamHandler to be the default.
 void setDefaultByteStreamHandler(IByteStreamHandler handler)
          Sets the current ByteStreamHandler to use for sending and receiving files.
 void setDefaultClassByteStreamHandler()
          Sets the current ClassByteStreamHandler to be the default.
 void setDefaultClassByteStreamHandler(IClassByteStreamHandler handler)
          Sets the current ClassByteStreamHandler to use for sending and receiving classes.
 void setDomainNotifier(IDomainNotifier domainNotifier)
          Sets the DataStore's IDomainNotifier
 void setGenerateBuffer(boolean flag)
          Indicates that the datastore should transfer a DataElement's buffer attribute in the communication layer
 DataElement setHost(DataElement localHostObject)
          Used at DataStore initialization time to indicate where to point the host root
 void setLoaders(ArrayList loaders)
          Sets the loaders for this DataStore.
 void setLogTimes(boolean flag)
          Tells the DataStore to log durations of commands
 void setObject(DataElement localObject)
          Makes a given client element available on the server
 void setObject(DataElement localObject, boolean noRef)
          Makes a given client element available on the server
 void setPreference(String property, String value)
          Sets a property value preference on the client and server datastore
 void setPreference(String property, String value, boolean remoteAndLocal)
          Sets a property value preference on the client datastore.
 void setReferenceTag(String tag)
          Sets what type of attribute tag is used on the peer DataStore to indicate whether dataelements are references, values, or spirit elements.
 void setRemoteIP(String remoteIP)
           
 void setServerMinor(int minor)
           
 void setServerVersion(int version)
           
protected  void setSpiritModeOnState()
           
 void setSSLProperties(ISSLProperties properties)
          Specifies the security properties of this DataStore.
 void setTicket(DataElement ticket)
          Sets the ticket for this DataStore.
 void setTimeoutValue(int time)
          Sets the maximum amount of time that the DataStore will wait to receive a response for a synchronous command
 void setUpdateHandler(UpdateHandler updateHandler)
          Sets the DataStore's handler for doing updates
 void setUpdateWaitTime(int time)
          Sets the time the update handler sleeps in between update requests
 boolean showTicket(String ticketStr)
          Used at DataStore initialization validate access to the DataStore
 void startDataElementRemoverThread()
           
 void startMemLogging()
           
 void startTracing()
           
 void startWaiting(DataElement status)
           
 void stopWaiting(DataElement status)
           
 DataElement synchronizedCommand(DataElement commandDescriptor, ArrayList arguments, DataElement dataObject)
          Creates and issues a synchronized command.
 DataElement synchronizedCommand(DataElement commandDescriptor, DataElement dataObject)
          Creates and issues a synchronized command.
 DataElement synchronizedCommand(DataElement commandDescriptor, DataElement dataObject, boolean noRef)
          Creates and issues a synchronized command.
 boolean ticketValid(DataElement ticket)
           
 void trace(String str)
           
 void trace(Throwable e)
           
 void update(ArrayList objects)
           
 void update(DataElement dataElement)
           
 void updateAppendFile(String remotePath, byte[] bytes, int size, boolean binary)
          Transfers and appends a file from a server to a client.
 void updateAppendFile(String remotePath, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Transfers and appends a file from a server to a client.
 void updateFile(String remotePath, byte[] bytes, int size, boolean binary)
          Transfers a file from a server to a client.
 void updateFile(String remotePath, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
          Transfers a file from a server to a client.
 void updateRemoteClassInstance(IRemoteClassInstance instance, String byteStreamHandlerId)
           
 boolean usingSSL()
           
 boolean validTicket()
          Indicates whether a client has permission to access the DataStore
 void waitUntil(DataElement status, String state)
          Wait until a given status element reached the specified state.
 void waitUntil(DataElement status, String state, int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOTE_CLASS_CACHE_JARFILE_NAME

public static final String REMOTE_CLASS_CACHE_JARFILE_NAME
See Also:
Constant Field Values

JARFILE_EXTENSION

public static final String JARFILE_EXTENSION
See Also:
Constant Field Values

SPIRIT_ON_INITIAL_SIZE

public static final int SPIRIT_ON_INITIAL_SIZE
See Also:
Constant Field Values
Constructor Detail

DataStore

public DataStore(DataStoreAttributes attributes)
Creates a new DataStore instance

Parameters:
attributes - the default attributes of the DataStore

DataStore

public DataStore(DataStoreAttributes attributes,
                 int initialSize)
Creates a new DataStore instance

Parameters:
attributes - the default attributes of the DataStore
initialSize - the initial number of preallocated DataElements

DataStore

public DataStore(DataStoreAttributes attributes,
                 CommandHandler commandHandler,
                 UpdateHandler updateHandler,
                 IDomainNotifier domainNotifier)
Creates a new DataStore instance

Parameters:
attributes - the default attributes of the DataStore
commandHandler - the DataStore's handler for sending commands
updateHandler - the DataStore's handler for doing updates
domainNotifier - the domain notifier
Since:
3.0 replaced DomainNotifier with IDomainNotifier

DataStore

public DataStore(DataStoreAttributes attributes,
                 CommandHandler commandHandler,
                 UpdateHandler updateHandler,
                 IDomainNotifier domainNotifier,
                 int initialSize)
Creates a new DataStore instance

Parameters:
attributes - the default attributes of the DataStore
commandHandler - the DataStore's handler for sending commands
updateHandler - the DataStore's handler for doing updates
domainNotifier - the domain notifier
initialSize - the initialNumber of preallocated DataElements
Since:
3.0 replaced DomainNotifier with IDomainNotifier
Method Detail

setSpiritModeOnState

protected void setSpiritModeOnState()

setServerVersion

public void setServerVersion(int version)

setServerMinor

public void setServerMinor(int minor)

getServerVersion

public int getServerVersion()

getServerMinor

public int getServerMinor()

setTicket

public void setTicket(DataElement ticket)
Sets the ticket for this DataStore. A ticket is used to prevent unauthorized users from accessing the DataStore

Parameters:
ticket - the DataElement representing the ticket

setLoaders

public void setLoaders(ArrayList loaders)
Sets the loaders for this DataStore. The loaders are used to load miners (extension tools).

Parameters:
loaders - the loaders for the miners this DataStore will be using

addLoader

public void addLoader(IExternalLoader loader)
Adds a loader for this DataStore. The loader is used to load miners (extension tools).

Parameters:
loader - the loader for the miners this DataStore will be using
Since:
3.0 replaced ExternalLoader by IExternalLoader

usingSSL

public boolean usingSSL()

setSSLProperties

public void setSSLProperties(ISSLProperties properties)
Specifies the security properties of this DataStore. These properties indicate whether or not to use SSL, the keystore location and password.

Parameters:
properties - the properties to set

getKeyStoreLocation

public String getKeyStoreLocation()

getKeyStorePassword

public String getKeyStorePassword()

addMinersLocation

public DataElement addMinersLocation(String minersLocation)
Tells the DataStore where to find the miners which it needs to load.

Parameters:
minersLocation - a string representing the location of the miners

addMinersLocation

public void addMinersLocation(DataElement location)
Tells the DataStore where to find the miners which it needs to load.

Parameters:
location - a DataElement representing the location of the miners

setConnected

public void setConnected(boolean isConnected)
Tells the DataStore that it is connected to it's tools

Parameters:
isConnected - indicates whether it is connected or not

setDomainNotifier

public void setDomainNotifier(IDomainNotifier domainNotifier)
Sets the DataStore's IDomainNotifier

Parameters:
domainNotifier - the domainNotifier
Since:
3.0 replaced DomainNotifier by IDomainNotifier

setUpdateHandler

public void setUpdateHandler(UpdateHandler updateHandler)
Sets the DataStore's handler for doing updates

Parameters:
updateHandler - the handler for doing updates

setCommandHandler

public void setCommandHandler(CommandHandler commandHandler)
Sets the DataStore's handler for sending commands to miners

Parameters:
commandHandler - the handler for sending commands to miners

setCompatibilityHandler

public void setCompatibilityHandler(IDataStoreCompatibilityHandler handler)
Set the compatibility handler for the client. This is used when potential compatibility problems are run into - i.e. localDescriptorQuery fails

Parameters:
handler - the compatibilityHandler to use
Since:
3.0

getCompatibilityHandler

public IDataStoreCompatibilityHandler getCompatibilityHandler()
Get the compatibility handler for the client. This is used when potential compatibility problems are run into - i.e. localDescriptorQuery fails

Returns:
the compatibilityHandler
Since:
3.0

setUpdateWaitTime

public void setUpdateWaitTime(int time)
Sets the time the update handler sleeps in between update requests

Parameters:
time - interval to wait

setCommandWaitTime

public void setCommandWaitTime(int time)
Sets the time the command handler sleeps in between command requests

Parameters:
time - interval to wait

setTimeoutValue

public void setTimeoutValue(int time)
Sets the maximum amount of time that the DataStore will wait to receive a response for a synchronous command

Parameters:
time - interval to wait

getTimeoutValue

public int getTimeoutValue()

getServerIdleShutdownTimeout

public int getServerIdleShutdownTimeout()
Gets the time the server may remain idle before shutting down

Returns:
the idle time before shutdown
Since:
3.0

setAttribute

public void setAttribute(int attribute,
                         String value)
Sets an attribute of the DataStore

Parameters:
attribute - index of the attribute to set
value - value to set the attribute at the give index

setLogTimes

public void setLogTimes(boolean flag)
Tells the DataStore to log durations of commands

Parameters:
flag - whether to log times or not

isVirtual

public boolean isVirtual()
Indicates whether this DataStore is virtual or not. A virtual DataStore is one that does not have it's own tools, but rather communicates with a non-virtual DataStore that does.

Returns:
whether the DataStore is virtual or not

isConnected

public boolean isConnected()
Indicates whether this DataStore is connected to it's miners or another DataStore

Returns:
whether the DataStore is connected or not

logTimes

public boolean logTimes()
Indicates whether this DataStore logs the durations of commands

Returns:
whether the DataStore logs command times or not

getTicket

public DataElement getTicket()
Returns the DataStore's ticket

Returns:
the ticket

getUpdateWaitTime

public int getUpdateWaitTime()
Returns the time the update handler waits between requests

Returns:
wait time

getCommandWaitTime

public int getCommandWaitTime()
Returns the time the command handler waits between requests

Returns:
wait time

getName

public String getName()
Returns the name of the DataStore

Returns:
the name of the DataStore

getRoot

public DataElement getRoot()
Returns the root DataElement in the DataStore. The root DataElement has no parent and contains every DataElement in the DataStore through a DataElement tree

Returns:
the root DataElement

getDummy

public DataElement getDummy()

getHostRoot

public DataElement getHostRoot()
Returns the host root DataElement in the DataStore. The host root DataElement is a child of root and references DataElements in the DataStore that are related to host information

Returns:
the host root DataElement

getExternalRoot

public DataElement getExternalRoot()

getMinerRoot

public DataElement getMinerRoot()
Returns the miner root DataElement in the DataStore. The miner root DataElement is a child of root and contains DataElements the represent tools and the information that tools possess

Returns:
the miner root DataElement

getStatus

public DataElement getStatus()
Returns the status of the DataStore.

Returns:
the status of the DataStore

getLogRoot

public DataElement getLogRoot()
Returns the log root DataElement of the DataStore. The log root contains all commands that are issued from the DataStore

Returns:
the log root

getDescriptorRoot

public DataElement getDescriptorRoot()
Returns the descriptor root DataElement of the DataStore. The descriptor root contains the schema for the DataStore and it's tools

Returns:
the descriptor root

getTempRoot

public DataElement getTempRoot()
Returns the temp root DataElement of the DataStore. The temp root contains temporary information.

Returns:
the temp root

getCommandHandler

public CommandHandler getCommandHandler()
Returns the handler for sending commands.

Returns:
the command handler

getUpdateHandler

public UpdateHandler getUpdateHandler()
Returns the handler for doing updates.

Returns:
the update handler

getLoaders

public ArrayList getLoaders()
Returns the loader that is used for loading miners.

Returns:
the loader

getLocalClassLoaders

public ArrayList getLocalClassLoaders()
Returns registered local classloaders.


registerLocalClassLoader

public void registerLocalClassLoader(ClassLoader loader)
Registers a local class loader. On the client, each subsystem must register its local class loader using this method so that if the subsystem's classes cannot be found on the server, they can be requested from the client, loaded using loader, transferred to the server, and then loaded on the server.


getContentsRelation

public DataElement getContentsRelation()

getAttributesRelation

public DataElement getAttributesRelation()

getAbstractedByRelation

public DataElement getAbstractedByRelation()

getAbstractsRelation

public DataElement getAbstractsRelation()

getMinersLocation

public ArrayList getMinersLocation()
Returns the location of the miners.

Returns:
the location of the miners

getDomainNotifier

public IDomainNotifier getDomainNotifier()
Returns the domain notifier.

Returns:
the domain notifier
Since:
3.0 replaced DomainNotifier by IDomainNotifier

getAttribute

public String getAttribute(int attribute)
Returns the attribute indicated by an index.

Parameters:
attribute - the index of the attribute to get
Returns:
the attribute

getNumElements

public int getNumElements()
Returns the number of live elements in the DataStore.

Returns:
the number of live elements

getNumRecycled

public int getNumRecycled()
Returns the number of recycled elements in the DataStore.

Returns:
the number of recycled elements

getHashMap

public HashMap getHashMap()
Returns the table of live elements in the DataStore.

Returns:
the table of live elements

createRoot

public void createRoot()
Initializes the DataStore by creating the root elements


createReference

public DataElement createReference(DataElement from,
                                   DataElement to)
Creates a contents relationship between two DataElements

Parameters:
from - the element that contains the other
to - the element that is contained by the other
Returns:
the new reference

createReference

public DataElement createReference(DataElement parent,
                                   DataElement realObject,
                                   DataElement relationType)
Creates a relationship between two DataElements given a type of relationship

Parameters:
parent - the element that references the other element
realObject - the element that is referenced by the parent element
relationType - the descriptor element that represents the type of relationship between parent and realObject
Returns:
the new reference

createReference

public DataElement createReference(DataElement parent,
                                   DataElement realObject,
                                   String relationType)
Creates a relationship between two DataElements given a type of relationship

Parameters:
parent - the element that references the other element
realObject - the element that is referenced by the parent element
relationType - the string that represents the type of relationship between parent and realObject
Returns:
the new reference

createReference

public DataElement createReference(DataElement parent,
                                   DataElement realObject,
                                   String relationType,
                                   boolean doRefresh)
Creates a relationship between two DataElements given a type of relationship

Parameters:
parent - the element that references the other element
realObject - the element that is referenced by the parent element
relationType - the string that represents the type of relationship between parent and realObject
doRefresh - indicates whether or not to refresh the parent of the new reference
Returns:
the new reference

createReferences

public void createReferences(DataElement from,
                             ArrayList to,
                             String type)
Creates a set of relationships between one DataElement and a set of DataElements given a type of relationship

Parameters:
from - the element that references the other elements
to - a list of elements that from references
type - the string that represents the type of relationships between from and to

createReferences

public void createReferences(DataElement from,
                             ArrayList to,
                             DataElement type)
Creates a set of relationships between one DataElement and a set of DataElements given a type of relationship

Parameters:
from - the element that references the other elements
to - a list of elements that from references
type - the descriptor element that represents the type of relationships between from and to

createReference

public DataElement createReference(DataElement parent,
                                   DataElement realObject,
                                   DataElement toRelation,
                                   DataElement fromRelation)
Creates a two-way relationship between two elements

Parameters:
parent - an element that references the other element
realObject - an element that references the other element
toRelation - the descriptor element that represents the type of relationship between parent and realObject
fromRelation - the descriptor element that represents the type of relationship between realObject and parent
Returns:
the new reference

createReference

public DataElement createReference(DataElement parent,
                                   DataElement realObject,
                                   String toRelation,
                                   String fromRelation)
Creates a two-way relationship between two elements

Parameters:
parent - an element that references the other element
realObject - an element that references the other element
toRelation - the string that represents the type of relationship between parent and realObject
fromRelation - the string that represents the type of relationship between realObject and parent
Returns:
the new reference

createReferences

public void createReferences(DataElement from,
                             ArrayList to,
                             DataElement toRel,
                             DataElement fromRel)
Creates a set of two-way relationship between a DataElement and a list of elements

Parameters:
from - an element that references the other elements
to - a list of elements that reference from
toRel - the descriptor element that represents the type of relationship between from and to
fromRel - the descriptor element that represents the type of relationship between to and from

createReferences

public void createReferences(DataElement from,
                             ArrayList to,
                             String toRel,
                             String fromRel)
Creates a set of two-way relationship between a DataElement and a list of elements

Parameters:
from - an element that references the other elements
to - a list of elements that reference from
toRel - the string that represents the type of relationship between from and to
fromRel - the string that represents the type of relationship between to and from

createTransientObject

public DataElement createTransientObject(String[] attributes)

createObject

public DataElement createObject(DataElement parent,
                                DataElement type,
                                String name)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the descriptor representing the type of the new element
name - the name of the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                String type,
                                String name)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the string representing the type of the new element
name - the name of the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                DataElement type,
                                String name,
                                String source)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the descriptor element representing the type of the new element
name - the name of the new element
source - the source location of the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                String type,
                                String name,
                                String source)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the string representing the type of the new element
name - the name of the new element
source - the source location of the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                DataElement type,
                                String name,
                                String source,
                                String sugId)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the descriptor element representing the type of the new element
name - the name of the new element
source - the source location of the new element
sugId - the suggested ID for the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                String type,
                                String name,
                                String source,
                                String sugId)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the string representing the type of the new element
name - the name of the new element
source - the source location of the new element
sugId - the suggested ID for the new element
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                DataElement type,
                                String name,
                                String source,
                                String sugId,
                                boolean isReference)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the descriptor element representing the type of the new element
name - the name of the new element
source - the source location of the new element
sugId - the suggested ID for the new element
isReference - an indication whether the new element is a reference
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                String type,
                                String name,
                                String source,
                                String sugId,
                                boolean isReference)
Creates a new DataElement

Parameters:
parent - the parent of the new element
type - the string representing the type of the new element
name - the name of the new element
source - the source location of the new element
sugId - the suggested ID for the new element
isReference - an indication whether the new element is a reference
Returns:
the new element

createObject

public DataElement createObject(DataElement parent,
                                String[] attributes)
Creates a new DataElement. This is normally called on client side via xml parser

Parameters:
parent - the parent of the new element
attributes - the attributes to use in this new element
Returns:
the new element

createAbstractObjectDescriptor

public DataElement createAbstractObjectDescriptor(DataElement parent,
                                                  String name)
Creates a new abstract object descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createAbstractObjectDescriptor

public DataElement createAbstractObjectDescriptor(DataElement parent,
                                                  String name,
                                                  String source)
Creates a new abstract object descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
Returns:
the new descriptor element

createObjectDescriptor

public DataElement createObjectDescriptor(DataElement parent,
                                          String name)
Creates a new object descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createObjectDescriptor

public DataElement createObjectDescriptor(DataElement parent,
                                          String name,
                                          String source)
Creates a new object descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the name of the new element
Returns:
the new descriptor element

createAbstractRelationDescriptor

public DataElement createAbstractRelationDescriptor(DataElement parent,
                                                    String name)
Creates a new abstract relation descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createAbstractRelationDescriptor

public DataElement createAbstractRelationDescriptor(DataElement parent,
                                                    String name,
                                                    String source)
Creates a new abstract relation descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
Returns:
the new descriptor element

createRelationDescriptor

public DataElement createRelationDescriptor(DataElement parent,
                                            String name)
Creates a new relation descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createRelationDescriptor

public DataElement createRelationDescriptor(DataElement parent,
                                            String name,
                                            String source)
Creates a new relation descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
Returns:
the new descriptor element

createAbstractCommandDescriptor

public DataElement createAbstractCommandDescriptor(DataElement parent,
                                                   String name)
Creates a new abstract command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createAbstractCommandDescriptor

public DataElement createAbstractCommandDescriptor(DataElement parent,
                                                   String name,
                                                   String value)
Creates a new abstract command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
value - the value used to identify the command
Returns:
the new descriptor element

createAbstractCommandDescriptor

public DataElement createAbstractCommandDescriptor(DataElement parent,
                                                   String name,
                                                   String source,
                                                   String value)
Creates a new abstract command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
value - the value used to identify the command
Returns:
the new descriptor element

createCommandDescriptor

public DataElement createCommandDescriptor(DataElement parent,
                                           String name)
Creates a new command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
Returns:
the new descriptor element

createCommandDescriptor

public DataElement createCommandDescriptor(DataElement parent,
                                           String name,
                                           String value)
Creates a new command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
value - the value used to identify the command
Returns:
the new descriptor element

createCommandDescriptor

public DataElement createCommandDescriptor(DataElement parent,
                                           String name,
                                           String source,
                                           String value)
Creates a new command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
value - the value used to identify the command
Returns:
the new descriptor element

createCommandDescriptor

public DataElement createCommandDescriptor(DataElement parent,
                                           String name,
                                           String source,
                                           String value,
                                           boolean visible)
Creates a new command descriptor DataElement

Parameters:
parent - the parent of the new element
name - the name of the new element
source - the source location of the new element
value - the value used to identify the command
visible - indicates whether the command is visible or not
Returns:
the new descriptor element

moveObject

public void moveObject(DataElement source,
                       DataElement target)
Moves a element from one location in the DataStore tree to another

Parameters:
source - the element to move
target - the element to move source to

deleteObjects

public void deleteObjects(DataElement from)
Deletes all the elements contained in from

Parameters:
from - the element from which to delete objects from

disconnectObjects

public void disconnectObjects(DataElement from)
Disconnect all the elements contained in from

Parameters:
from - the element from which to disconnect objects

deleteObject

public void deleteObject(DataElement from,
                         DataElement toDelete)
Deletes an element from another element

Parameters:
from - the element from which to delete an object from
toDelete - the element to remove

disconnectObject

public void disconnectObject(DataElement toDisconnect)
Disconnects an element and makes it a "spirit"

Parameters:
toDisconnect - the element to disconnect

replaceDeleted

public DataElement replaceDeleted(DataElement deletedObject)
Replaces a deleted object


contains

public boolean contains(String id)
Checks if a DataElement with a given ID exists in the DataStore

Parameters:
id - the id to look for
Returns:
whether it exists or not

refresh

public void refresh(ArrayList elements)
Refresh a set of DataElements

Parameters:
elements - a list of elements to refresh

refresh

public void refresh(DataElement element)
Refresh a DataElement

Parameters:
element - an element to refresh

refresh

public void refresh(DataElement element,
                    boolean immediate)
Refresh a DataElement - immediately if indicated

Parameters:
element - an element to refresh
immediate - indicates to do the refresh immediately

refresh

public void refresh(DataElement element,
                    int depth,
                    boolean immediate)
Refresh a DataElement and its children to a certain depth - immediately if indicated

Parameters:
element - an element to refresh
depth - The depth to refresh the elements descendants. A depth of 0 means only the element itself is refreshed; 1 means the element and its children are refreshed, 2 - it, its children, and its grandchildren, etc.
immediate - indicates to do the refresh immediately. If true, the update handler will send updates for each refreshed element in the subtree of depth depth below the element.

update

public void update(ArrayList objects)

update

public void update(DataElement dataElement)

updateRemoteClassInstance

public void updateRemoteClassInstance(IRemoteClassInstance instance,
                                      String byteStreamHandlerId)

updateFile

public void updateFile(String remotePath,
                       byte[] bytes,
                       int size,
                       boolean binary)
Transfers a file from a server to a client. This should only be called from a miner on a different machine from the client. If a file exists on the client side that the server file maps to then the existing client file will be replaced.

Parameters:
remotePath - the path of the file on the client side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text

updateFile

public void updateFile(String remotePath,
                       byte[] bytes,
                       int size,
                       boolean binary,
                       String byteStreamHandlerId)
Transfers a file from a server to a client. This should only be called from a miner on a different machine from the client. If a file exists on the client side that the server file maps to then the existing client file will be replaced.

Parameters:
remotePath - the path of the file on the client side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text
byteStreamHandlerId - indicates the client byte stream handler to receive the bytes

updateAppendFile

public void updateAppendFile(String remotePath,
                             byte[] bytes,
                             int size,
                             boolean binary)
Transfers and appends a file from a server to a client. This should only be called from a miner on a different machine from the client. If a file exists on the client side that the server file maps to then the existing client file will be appended to

Parameters:
remotePath - the path of the file on the client side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text

updateAppendFile

public void updateAppendFile(String remotePath,
                             byte[] bytes,
                             int size,
                             boolean binary,
                             String byteStreamHandlerId)
Transfers and appends a file from a server to a client. This should only be called from a miner on a different machine from the client. If a file exists on the client side that the server file maps to then the existing client file will be appended to

Parameters:
remotePath - the path of the file on the client side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text
byteStreamHandlerId - indicates the client byte stream handler to receive the bytes

replaceFile

public void replaceFile(String remotePath,
                        byte[] bytes,
                        int size,
                        boolean binary,
                        String byteStreamHandlerId)
Transfers a file from a client to a server. The should only be called from a client on a different machine from the server. If a file exists on the server side that the client file maps to then the existing server file will be replaced.

Parameters:
remotePath - the path of the file on the server side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text
byteStreamHandlerId - indicates which byteStreamHandler to use to receive the bytes

replaceFile

public void replaceFile(String remotePath,
                        byte[] bytes,
                        int size,
                        boolean binary)
Transfers a file from a client to a server. The should only be called from a client on a different machine from the server. If a file exists on the server side that the client file maps to then the existing server file will be replaced.

Parameters:
remotePath - the path of the file on the server side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text

replaceAppendFile

public void replaceAppendFile(String remotePath,
                              byte[] bytes,
                              int size,
                              boolean binary,
                              String byteStreamHandlerId)
Transfers a file from a client to a server. The should only be called from a client on a different machine from the server. If a file exists on the server side that the client file maps to then the existing server file will be appended to.

Parameters:
remotePath - the path of the file on the server side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text
byteStreamHandlerId - indicates which byte stream handler to use to receive the bytes

replaceAppendFile

public void replaceAppendFile(String remotePath,
                              byte[] bytes,
                              int size,
                              boolean binary)
Transfers a file from a client to a server. The should only be called from a client on a different machine from the server. If a file exists on the server side that the client file maps to then the existing server file will be appended to.

Parameters:
remotePath - the path of the file on the server side
bytes - an array of bytes representing a file
size - the number of bytes to transfer
binary - indicates whether to send the bytes as binary or text

setObject

public void setObject(DataElement localObject)
Makes a given client element available on the server

Parameters:
localObject - the element to transfer

setObject

public void setObject(DataElement localObject,
                      boolean noRef)
Makes a given client element available on the server

Parameters:
localObject - the element to transfer
noRef - indicates whether the element is a reference or not

modifyObject

public void modifyObject(DataElement localObject)

setHost

public DataElement setHost(DataElement localHostObject)
Used at DataStore initialization time to indicate where to point the host root

Parameters:
localHostObject - the client host element to transfer to the server site

getSchema

public DataElement getSchema()
Used at DataStore initialization time to setup the schema


setPreference

public void setPreference(String property,
                          String value)
Sets a property value preference on the client and server datastore

Parameters:
property - the property to set
value - the value of the property

setPreference

public void setPreference(String property,
                          String value,
                          boolean remoteAndLocal)
Sets a property value preference on the client datastore. If remoteAndLocal is set then the property get set on the server side as well as the client.

Parameters:
property - the property to set
value - the value of the property
remoteAndLocal - whether to propagate the change to the server
Since:
3.0

getPreference

public String getPreference(String property)

addDataStorePreferenceListener

public void addDataStorePreferenceListener(IDataStorePreferenceListener listener)
Adds a preference change listener to the DataStore

Parameters:
listener - the listener to add
Since:
3.0

removeDataStorePreferenceListener

public void removeDataStorePreferenceListener(IDataStorePreferenceListener listener)
Removes a specific preference change listener from the Datastore

Parameters:
listener - the listener to remove
Since:
3.0

removeAllDataStorePreferenceListeners

public void removeAllDataStorePreferenceListeners()
Removes all the preference change listeners

Since:
3.0

activateMiner

public DataElement activateMiner(String minerId)
Used to load and initialize a new miner on the host

Parameters:
minerId - the qualified classname of the miner to load
Returns:
the status of the activate miner command

initMiners

public DataElement initMiners()
Used at DataStore initialization time to initialize the miners

Returns:
the status element for the initMiners command

queryInstall

public DataElement queryInstall()

queryClientIP

public DataElement queryClientIP()

queryServerSpiritState

public boolean queryServerSpiritState()

queryHostJVM

public DataElement queryHostJVM()

runRemoteClassInstance

public void runRemoteClassInstance(IRemoteClassInstance runnable)

showTicket

public boolean showTicket(String ticketStr)
Used at DataStore initialization validate access to the DataStore

Parameters:
ticketStr - ticket string
Returns:
and indication of whether the ticket is valid or not

ticketValid

public boolean ticketValid(DataElement ticket)

createTicket

public DataElement createTicket(String ticketStr)

queryShowTicket

public DataElement queryShowTicket(DataElement ticket)

validTicket

public boolean validTicket()
Indicates whether a client has permission to access the DataStore

Returns:
and indication of whether the ticket is valid or not

waitUntil

public void waitUntil(DataElement status,
                      String state)
Wait until a given status element reached the specified state. This is used for issuing synchronized commands

Parameters:
status - the status element
state - the state to wait until

isWaiting

public boolean isWaiting(DataElement status)

stopWaiting

public void stopWaiting(DataElement status)

startWaiting

public void startWaiting(DataElement status)

waitUntil

public void waitUntil(DataElement status,
                      String state,
                      int timeout)

cleanBadReferences

public void cleanBadReferences(DataElement root)

cancelAllCommands

public void cancelAllCommands()
Tells the command handler to cancel all pending commands.


synchronizedCommand

public DataElement synchronizedCommand(DataElement commandDescriptor,
                                       DataElement dataObject)
Creates and issues a synchronized command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
dataObject - the subject of the command
Returns:
the status of the command

synchronizedCommand

public DataElement synchronizedCommand(DataElement commandDescriptor,
                                       DataElement dataObject,
                                       boolean noRef)
Creates and issues a synchronized command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
dataObject - the subject of the command
noRef - and indication of whether the subject should be referenced or not
Returns:
the status of the command

synchronizedCommand

public DataElement synchronizedCommand(DataElement commandDescriptor,
                                       ArrayList arguments,
                                       DataElement dataObject)
Creates and issues a synchronized command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
arguments - the arguments for the command
dataObject - the subject of the command
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           ArrayList arguments,
                           DataElement dataObject)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
arguments - the arguments for the command
dataObject - the subject of the command
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           ArrayList arguments,
                           DataElement dataObject,
                           boolean immediate)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
arguments - the arguments for the command
dataObject - the subject of the command
immediate - indicates whether the command should be placed first on the request queue
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           DataElement arg,
                           DataElement dataObject)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
arg - an argument for the command
dataObject - the subject of the command
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           DataElement arg,
                           DataElement dataObject,
                           boolean immediate)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
arg - an argument for the command
dataObject - the subject of the command
immediate - indicates whether the command should be placed first on the request queue
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           DataElement dataObject)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
dataObject - the subject of the command
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           DataElement dataObject,
                           boolean noRef)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
dataObject - the subject of the command
noRef - an indication of whether to reference the subject or not
Returns:
the status of the command

command

public DataElement command(DataElement commandDescriptor,
                           DataElement dataObject,
                           boolean noRef,
                           boolean immediate)
Creates and issues a command.

Parameters:
commandDescriptor - the comamnd descriptor for the command
dataObject - the subject of the command
noRef - an indication of whether to reference the subject or not
immediate - an indication of whether
Returns:
the status of the command

command

public DataElement command(DataElement commandObject)
Issues a command.

Parameters:
commandObject - an instance of a command
Returns:
the status of the command

flush

public void flush()
Delete information from the DataStore.


flush

public void flush(DataElement element)
Delete information from the DataStore contained by an element.

Parameters:
element - the element from which to delete

localDescriptorQuery

public DataElement localDescriptorQuery(DataElement object,
                                        String keyName)
Find a command descriptor element in the schema with the given value.

Parameters:
object - the object descriptor representing the type of object that can issue such a command
keyName - the value of the command to search for
Returns:
the command descriptor for the specified command

localDescriptorQuery

public DataElement localDescriptorQuery(DataElement descriptor,
                                        String keyName,
                                        int depth)
Find a command descriptor element in the schema with the given value.

Parameters:
descriptor - the object descriptor representing the type of object that can issue such a command
keyName - the value of the command to search for
depth - the depth of abstraction to search
Returns:
the command descriptor for the specified command

addToRecycled

public void addToRecycled(DataElement toRecycle)

getMinerFor

public DataElement getMinerFor(DataElement commandDescriptor)
Finds the element that represents the miner that implements a particular command.

Parameters:
commandDescriptor - a command descriptor
Returns:
the element representing a miner

findObjectsOfType

public List findObjectsOfType(DataElement root,
                              DataElement type)
Finds all the elements that are of a given type from a specified element.

Parameters:
root - where to search from
type - the descriptor representing the type of the objects to search for
Returns:
a list of elements

findObjectsOfType

public List findObjectsOfType(DataElement root,
                              String type)
Finds all the elements that are of a given type from a specified element.

Parameters:
root - where to search from
type - the descriptor representing the type of the objects to search for
Returns:
a list of elements

findDeleted

public List findDeleted(DataElement root)
Finds all the deleted elements

Parameters:
root - where to search from
Returns:
a list of elements

findDeleted

public List findDeleted(DataElement root,
                        int depth)
Finds all the deleted elements

Parameters:
root - where to search from
depth - the depth to search
Returns:
a list of elements

getRelationItems

public ArrayList getRelationItems(DataElement descriptor,
                                  String fixateOn)
Finds all relationship descriptor types that can be applied to a particular element.

Parameters:
descriptor - the object descriptor that uses relationships
fixateOn - a filter for the type of relationships to look for
Returns:
a list of relationship descriptor elements

searchForPattern

public ArrayList searchForPattern(DataElement root,
                                  int attribute,
                                  String pattern,
                                  boolean ignoreCase)
Find all elements from a given element that match a certain attribute.

Parameters:
root - the element to search from
attribute - the index of the attribute to match
pattern - the value to compare with the attribute
ignoreCase - an indication whether to ignore case for the attribute or not
Returns:
the list of matches

searchForPattern

public ArrayList searchForPattern(DataElement root,
                                  ArrayList attributes,
                                  ArrayList patterns,
                                  boolean ignoreCase)
Find all elements from a given element that match a certain set of attributes.

Parameters:
root - the element to search from
attributes - a list of attributes to match
patterns - a list of values to compare with the attributes
ignoreCase - an indication whether to ignore case for the attributes or not
Returns:
the list of matches

searchForPattern

public ArrayList searchForPattern(DataElement root,
                                  int[] attributes,
                                  String[] patterns,
                                  int numAttributes,
                                  boolean ignoreCase)
Find all elements from a given element that match a certain set of attributes.

Parameters:
root - the element to search from
attributes - a list of attribute indexes to match
patterns - a list of values to compare with the attributes
numAttributes - the number of attributes to match
ignoreCase - an indication whether to ignore case for the attributes or not
Returns:
the list of matches

searchForPattern

public ArrayList searchForPattern(DataElement root,
                                  int[] attributes,
                                  String[] patterns,
                                  int numAttributes,
                                  boolean ignoreCase,
                                  int depth)
Find all elements from a given element that match a certain set of attributes.

Parameters:
root - the element to search from
attributes - a list of attribute indexes to match
patterns - a list of values to compare with the attributes
numAttributes - the number of attributes to match
ignoreCase - an indication whether to ignore case for the attributes or not
depth - how deep to search
Returns:
the list of matches

searchForPattern

public ArrayList searchForPattern(DataElement root,
                                  int[] attributes,
                                  String[] patterns,
                                  int numAttributes,
                                  boolean ignoreCase,
                                  int depth,
                                  ArrayList searched)
Find all elements from a given element that match a certain set of attributes.

Parameters:
root - the element to search from
attributes - a list of attribute indexes to match
patterns - a list of values to compare with the attributes
numAttributes - the number of attributes to match
ignoreCase - an indication whether to ignore case for the attributes or not
depth - how deep to search
searched - a list of objects already searched
Returns:
the list of matches

findMinerInformation

public DataElement findMinerInformation(String minerName)
Returns the element that represents the specified miner's data.

Parameters:
minerName - the qualified name of the miner
Returns:
the element representing the miner information

findDescriptor

public DataElement findDescriptor(String type,
                                  String name)
Finds a descriptor element with a specified type and name.

Parameters:
type - the type of the descriptor
name - the name of the descriptor
Returns:
the found descriptor

findObjectDescriptor

public DataElement findObjectDescriptor(String name)
Finds an object descriptor element with a specified name.

Parameters:
name - the name of the descriptor
Returns:
the found descriptor

findRelationDescriptor

public DataElement findRelationDescriptor(String name)
Finds an relation descriptor element with a specified name.

Parameters:
name - the name of the descriptor
Returns:
the found descriptor

findCommandDescriptor

public DataElement findCommandDescriptor(String name)
Finds an command descriptor element with a specified name.

Parameters:
name - the name of the descriptor
Returns:
the found descriptor

find

public DataElement find(String id)
Finds an element with the specified ID.

Parameters:
id - the ID of the descriptor
Returns:
the found element

find

public DataElement find(DataElement root,
                        int attribute,
                        String name)
Finds an element matching a specified attribute and name.

Parameters:
root - the element to search from
attribute - the index of the attribute to compare
name - the name of the element
Returns:
the first found element

find

public DataElement find(DataElement root,
                        int attribute,
                        String name,
                        int depth)
Finds an element matching a specified attribute and name.

Parameters:
root - the element to search from
attribute - the index of the attribute to compare
name - the name of the element
depth - the depth of the search
Returns:
the first found element

mapToLocalPath

public String mapToLocalPath(String aPath)
Get the mapping from a remote path to a local path.

Parameters:
aPath - the remote path
Returns:
the local path

saveFile

public void saveFile(DataElement root,
                     String remotePath,
                     int depth)
Persist the DataStore tree from a given root

Parameters:
root - the element to persist from
remotePath - the path where the persisted file should be saved
depth - the depth of persistence from the root

saveFile

public void saveFile(String remotePath,
                     byte[] buffer,
                     int size,
                     boolean binary)
Save a file in the specified location

Parameters:
remotePath - the path where to save the file
buffer - the buffer to save in the file

saveFile

public void saveFile(String remotePath,
                     byte[] buffer,
                     int size,
                     boolean binary,
                     String byteStreamHandlerId)
Save a file in the specified location

Parameters:
remotePath - the path where to save the file
buffer - the buffer to save in the file
byteStreamHandlerId - indicates which byte stream handler to receive the bytes

saveClass

public void saveClass(String className,
                      byte[] buffer,
                      int size)
Saves a class to memory (but not to disk) where it can then be loaded by the RemoteClassLoaders. The class will be saved in a new thread, so this method will potentially return before the class has been saved.

Parameters:
className - the fully qualified name of the class
buffer - the contents of the class
size - the size of the buffer

saveClassInstance

public void saveClassInstance(byte[] buffer,
                              int size,
                              String classbyteStreamHandlerId)
Saves a class instance

Parameters:
buffer - the contents of the class
size - the size of the buffer
classbyteStreamHandlerId - the id for the byte stream handler

saveClass

public void saveClass(String className,
                      byte[] buffer,
                      int size,
                      String classbyteStreamHandlerId)
Saves a class to memory (but not to disk) where it can then be loaded by the RemoteClassLoaders. The class will be saved in a new thread, so this method will potentially return before the class has been saved.

Parameters:
className - the fully qualified name of the class
buffer - the contents of the class
size - the size of the buffer
classbyteStreamHandlerId - indicates which class byte stream handler to receive the bytes

appendToFile

public void appendToFile(String remotePath,
                         byte[] buffer,
                         int size,
                         boolean binary)
Append a file to the specified location

Parameters:
remotePath - the path where to save the file
buffer - the buffer to append into the file

appendToFile

public void appendToFile(String remotePath,
                         byte[] buffer,
                         int size,
                         boolean binary,
                         String byteStreamHandlerId)
Append a file to the specified location

Parameters:
remotePath - the path where to save the file
buffer - the buffer to append into the file
byteStreamHandlerId - indicates which byte stream handler to receive the bytes

load

public void load(DataElement root,
                 String pathName)
Load a persisted DataStore tree into the specified DataElement

Parameters:
root - the root element of the persisted tree
pathName - the location of the persisted file

loadFile

public static FileInputStream loadFile(String fileName)

filter

public boolean filter(DataElement descriptor,
                      DataElement dataElement)
Indicate whether a given descriptor can contain the specified element

Parameters:
descriptor - the object descriptor to test
dataElement - the object to test against
Returns:
and indication whether dataElement can be in an object of type descriptor

filter

public boolean filter(DataElement descriptor,
                      DataElement dataElement,
                      int depth)
Indicate whether a given descriptor can contain the specified element

Parameters:
descriptor - the object descriptor to test
dataElement - the object to test against
depth - how far to search
Returns:
and indication whether dataElement can be in an object of type descriptor

filter

public boolean filter(ArrayList descriptors,
                      DataElement dataElement)
Indicate whether a given set of descriptors can contain the specified element

Parameters:
descriptors - the object descriptors to test
dataElement - the object to test against
Returns:
and indication whether dataElement can be in an object of type descriptor

isTransient

public boolean isTransient(DataElement commandObject)
Indicate whether an command is specified as transient

Parameters:
commandObject - the object descriptors to test
Returns:
and indication whether the command is transient

enableAutoRefresh

public void enableAutoRefresh(boolean flag)

isAutoRefreshOn

public boolean isAutoRefreshOn()

getUserPreferencesDirectory

public String getUserPreferencesDirectory()
getUserPreferencesDirectory() - returns directory on IFS where to store user settings


startDataElementRemoverThread

public void startDataElementRemoverThread()

isDoSpirit

public boolean isDoSpirit()

receiveStartSpiritCommand

public void receiveStartSpiritCommand()

getDefaultByteStreamHandler

public IByteStreamHandler getDefaultByteStreamHandler()

getDefaultClassByteStreamHandler

public IClassByteStreamHandler getDefaultClassByteStreamHandler()

getByteStreamHandler

public IByteStreamHandler getByteStreamHandler(String id)

getClassByteStreamHandler

public IClassByteStreamHandler getClassByteStreamHandler(String id)

setRemoteIP

public void setRemoteIP(String remoteIP)

getRemoteIP

public String getRemoteIP()

setDefaultByteStreamHandler

public void setDefaultByteStreamHandler()
Sets the current ByteStreamHandler to be the default.


setDefaultClassByteStreamHandler

public void setDefaultClassByteStreamHandler()
Sets the current ClassByteStreamHandler to be the default.


setDefaultByteStreamHandler

public void setDefaultByteStreamHandler(IByteStreamHandler handler)
Sets the current ByteStreamHandler to use for sending and receiving files.

Parameters:
handler - the ByteStreamHandler to use

getRemoteClassLoader

public RemoteClassLoader getRemoteClassLoader()

setDefaultClassByteStreamHandler

public void setDefaultClassByteStreamHandler(IClassByteStreamHandler handler)
Sets the current ClassByteStreamHandler to use for sending and receiving classes.

Parameters:
handler - the ClassByteStreamHandler to use

registerByteStreamHandler

public void registerByteStreamHandler(IByteStreamHandler handler)
Registers a byte stream handler.

Parameters:
handler - the handler to register

registerClassByteStreamHandler

public void registerClassByteStreamHandler(IClassByteStreamHandler handler)
Registers a class byte stream handler.

Parameters:
handler - the handler to register

setByteConverter

public void setByteConverter(IByteConverter converter)

getByteConverter

public IByteConverter getByteConverter()

getLastCreatedElements

public List getLastCreatedElements()

generateId

protected String generateId()
Generates a new unique ID to be used by a DataElement

Returns:
the new id

startTracing

public void startTracing()

startMemLogging

public void startMemLogging()

memLog

public void memLog(String str)

trace

public void trace(String str)

trace

public void trace(Throwable e)

finish

public void finish()

requestClass

public void requestClass(String className)
On the server, sends a class request through the ServerUpdateHandler to the client. On the client, sends the request through the ClientCommandHandler

Parameters:
className - The fully qualified name of the class to request.

sendKeepAliveRequest

public void sendKeepAliveRequest()
On the server, sends a keepalive request through the ServerUpdateHandler to the client.


sendClass

public void sendClass(String className)
On the server, sends a class through the ServerCommandHandler to the client. On the client, sends the class through the ClientUpdateHandler

Parameters:
className - The fully qualified name of the class to request.

getClassRequestRepository

public HashMap getClassRequestRepository()
Returns:
the central repository for all class requests initiated by this server and its RemoteClassLoaders.

cacheClass

public void cacheClass(String className,
                       byte[] bytes,
                       int size)
Saves a class to disk (caches it) so that it can be loaded by the classloader without needing to download it again


createNewCacheJar

protected JarOutputStream createNewCacheJar(File newJar)
                                     throws IOException
Throws:
IOException

assignCacheJar

protected void assignCacheJar()

getCacheDirectory

protected String getCacheDirectory()

getRemoteClassLoaderCache

public File getRemoteClassLoaderCache()

sendKeepAliveConfirmation

public void sendKeepAliveConfirmation()

getReferenceTag

public String getReferenceTag()
Returns:
what type of attribute tag is used on the peer DataStore to indicate whether dataelements are references, values, or spirit elements. If the peer DataStore is an older one, this will return "isRef", if its up-to-date, it will return "refType", and if the tag hasnt been determined yet, this method will return null.

setReferenceTag

public void setReferenceTag(String tag)
Sets what type of attribute tag is used on the peer DataStore to indicate whether dataelements are references, values, or spirit elements.


printTree

public int printTree(String indent,
                     DataElement root)
Since:
3.0

printTree

public int printTree(String indent,
                     int number,
                     DataElement root)
Since:
3.0

setGenerateBuffer

public void setGenerateBuffer(boolean flag)
Indicates that the datastore should transfer a DataElement's buffer attribute in the communication layer

Parameters:
flag - true if the DataElement buffer attribute should be transfered
Since:
3.0

setClient

public void setClient(Client client)
This method is used to set the Client object for each user. The _client variable is null until setClient() is called. After _client is set, it can not be changed. This method should only be called once to associate a particular client with a DataStore. By default, the client for the user of the DataStore process is set but, when there is an ISystemService, the daemon sets the client.

Parameters:
client - the object of the Client class
Since:
3.0

getClient

public Client getClient()
This method is used to get the object of the Client stored for each user.

Returns:
the object of the Client stored for each user
Since:
3.0

Remote System Explorer DataStore
Release 3.4

Copyright (c) IBM Corporation and others 2000, 2012. All Rights Reserved.