TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.trace.ui
Class HyadesUtil

java.lang.Object
  extended by org.eclipse.hyades.trace.ui.HyadesUtil

public class HyadesUtil
extends java.lang.Object


Field Summary
static int CONNECTION_CONTROLLER_ERROR
           
static int CONNECTION_HOST_ERROR
           
static int CONNECTION_PORT_ERROR
           
static int CONNECTION_SUCCESS
          Test the Agent Controller connection on a host with given port number
 
Constructor Summary
HyadesUtil()
           
 
Method Summary
static java.lang.String change(java.lang.String in, java.lang.String oldPat, java.lang.String newPat)
          Changes all occurrences of oldPat to newPat, in the input String and returns the result.
static void cleanupResources(java.lang.String navigatorID)
          Cleans up the resources for the given navigatorID
static java.lang.String codeLogAgentName(java.lang.String type, java.lang.String name, java.lang.String userInput)
           
static short containsMixedResources(TRCAgentProxy[] agentProxies)
          Returns a value specifying whether the given log agent proxies contain mixed resources.
static org.eclipse.hyades.ui.internal.navigator.INavigator getActiveNavigator()
          Returns the active navigator.
static java.lang.String getAgentLabel(TRCAgentProxy a)
          Returns an appropriate label for the given agent.
static java.lang.String getAgentName(TRCAgentProxy agent)
          Returns the displayable agent name for the given agent.
static java.lang.String getAgentType(TRCAgentProxy agent)
           
static void getAgentType(TRCMonitor monitor, java.util.Vector agentTypeList)
          Will add the list of agent types, under this monitor, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564
static void getAgentType(TRCNode node, java.util.Vector agentTypeList)
          Will add the list of agent types, under this node, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564
static void getAgentType(TRCProcessProxy process, java.util.Vector agentTypeList)
          Will add the list of agent types, under this process, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564
static java.lang.String getLocalPortNumber()
          Returns the local port number specified in the AC preference pages
static java.util.List getLogAgentInProcess(org.eclipse.emf.ecore.EObject selObject)
          Returns a list of log objects in the given process.
static java.util.Collection getLogAgents(org.eclipse.emf.ecore.EObject eObject)
          Returns the log agents associated with the given object.
static java.util.Collection getLogAgents(org.eclipse.emf.ecore.EObject eObject, int type)
          Returns the log agents associated with the given object and type of log.
static java.util.List getLogObjectInMonitor(org.eclipse.emf.ecore.EObject selObject)
          Returns a list of log objects in the given monitor.
static java.util.List getLogObjectInNode(org.eclipse.emf.ecore.EObject selObject)
          Returns a list of log objects in the given node.
static org.eclipse.emf.ecore.EObject getMofObject()
          Returns the selected trace or log object in the Profiling Monitors view or Log Navigator.
static java.util.List getMonitors(org.eclipse.core.resources.IResource resource, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Returns the monitors associated with the given resouce and resource set.
static org.eclipse.emf.ecore.EObject getNavigatorSelection(org.eclipse.hyades.ui.internal.navigator.INavigator navigator)
          Returns the selection for the given navigator.
static org.eclipse.emf.ecore.EObject getObjectToView(org.eclipse.emf.ecore.EObject selObject)
          Returns the object that should be viewed for the given selection object.
static java.util.Collection getProcesses(TRCMonitor monitor)
          Returns the processes associated with the given monitor
static java.lang.String getProcessName(TRCProcessProxy process)
          Returns an appropriate label for the given process.
static java.util.List getResources(org.eclipse.core.resources.IProject project)
          Returns the resources associated with the given project.
static org.eclipse.core.resources.IResource getSelectionFolder(org.eclipse.hyades.ui.internal.navigator.INavigator viewer)
          Returns the folder for the given viewer.
static org.eclipse.core.resources.IResource getSelectionFolder(java.lang.Object selection)
          Returns the folder for the given selection
static java.lang.String resolveLogAgentDisplayName(java.lang.String name)
           
static java.lang.String resolveLogAgentPath(java.lang.String name)
           
static java.lang.String resolveLogAgentType(java.lang.String name)
           
static int testConnection(java.lang.String host, java.lang.String port, boolean message, org.eclipse.swt.widgets.Shell shell)
          Tests the connection of the given host and port returning the status of the test.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_SUCCESS

public static final int CONNECTION_SUCCESS
Test the Agent Controller connection on a host with given port number

See Also:
Constant Field Values

CONNECTION_CONTROLLER_ERROR

public static final int CONNECTION_CONTROLLER_ERROR
See Also:
Constant Field Values

CONNECTION_HOST_ERROR

public static final int CONNECTION_HOST_ERROR
See Also:
Constant Field Values

CONNECTION_PORT_ERROR

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

HyadesUtil

public HyadesUtil()
Method Detail

getSelectionFolder

public static org.eclipse.core.resources.IResource getSelectionFolder(java.lang.Object selection)
Returns the folder for the given selection

Parameters:
selection - an Object, the selection
Returns:
an IResource, the folder for the selection

getSelectionFolder

public static org.eclipse.core.resources.IResource getSelectionFolder(org.eclipse.hyades.ui.internal.navigator.INavigator viewer)
Returns the folder for the given viewer.

Parameters:
selection - an INavigator, the viewer
Returns:
an IResource, the folder for the viewer

getAgentLabel

public static java.lang.String getAgentLabel(TRCAgentProxy a)
Returns an appropriate label for the given agent. (i.e. , , etc)

Parameters:
a - TRCAgentProxy instance
Returns:
String the label

getAgentName

public static java.lang.String getAgentName(TRCAgentProxy agent)
Returns the displayable agent name for the given agent.

Parameters:
agent - a TRCAgentProxy, the agent for which the displayable name is returned.
Returns:
java.lang.String

getActiveNavigator

public static org.eclipse.hyades.ui.internal.navigator.INavigator getActiveNavigator()
Returns the active navigator.

Returns:
an INavigator, the active navigator

containsMixedResources

public static short containsMixedResources(TRCAgentProxy[] agentProxies)
Returns a value specifying whether the given log agent proxies contain mixed resources.

Parameters:
agentProxies - an array of TRCAgentProxy instances, the agent proxies
Returns:
-1 if all agents are XMI serialized 0 if agents are mixed XMI and DB 1 if all agents are DB serialized but are serizalized into different databases. 2 if all agents are DB serialized into the same database.

getLogAgents

public static java.util.Collection getLogAgents(org.eclipse.emf.ecore.EObject eObject)
Returns the log agents associated with the given object.

Parameters:
eObject - an EObject, the given object.
Returns:
a Collection, the log agents.

getProcesses

public static java.util.Collection getProcesses(TRCMonitor monitor)
Returns the processes associated with the given monitor

Parameters:
monitor - a TRCMonitor, the given monitor
Returns:
a Collection, the processes

getResources

public static java.util.List getResources(org.eclipse.core.resources.IProject project)
Returns the resources associated with the given project.

Parameters:
project - an IProject, the given project
Returns:
a List, the resources

getMonitors

public static java.util.List getMonitors(org.eclipse.core.resources.IResource resource,
                                         org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Returns the monitors associated with the given resouce and resource set.

Parameters:
resource - an IResource, the given resource
resourceSet - a ResourceSet, the given resource set
Returns:
a List, the monitors

change

public static java.lang.String change(java.lang.String in,
                                      java.lang.String oldPat,
                                      java.lang.String newPat)
Changes all occurrences of oldPat to newPat, in the input String and returns the result.

Parameters:
in - a String, the input String
oldPat - a String, the pattern to be replaced
newPat - a String, the pattern replacing the old pattern
Returns:
a String, the changed input String

getMofObject

public static org.eclipse.emf.ecore.EObject getMofObject()
Returns the selected trace or log object in the Profiling Monitors view or Log Navigator.

Returns:
an EObject, the selected object

getNavigatorSelection

public static org.eclipse.emf.ecore.EObject getNavigatorSelection(org.eclipse.hyades.ui.internal.navigator.INavigator navigator)
Returns the selection for the given navigator.

Parameters:
navigator - an INavigator instance, the given navigator
Returns:
an EObject, the selection

testConnection

public static int testConnection(java.lang.String host,
                                 java.lang.String port,
                                 boolean message,
                                 org.eclipse.swt.widgets.Shell shell)
Tests the connection of the given host and port returning the status of the test.

Parameters:
host - a String, the host for testing the connection
port - a String, the port associated with the host
message - a boolean if true, displays a popup message
shell - a Shell instance the shell for any popup messages
Returns:
an int, the test connection result

getObjectToView

public static org.eclipse.emf.ecore.EObject getObjectToView(org.eclipse.emf.ecore.EObject selObject)
Returns the object that should be viewed for the given selection object. For example, if the process node is selected, the view should display the profiling data if trace collects profiling data. It will return the agent if there is only one log agent.

Parameters:
selObject - an EObject, the selected object
Returns:
an EObject, the object that should be viewed

getLogAgentInProcess

public static java.util.List getLogAgentInProcess(org.eclipse.emf.ecore.EObject selObject)
Returns a list of log objects in the given process.

Parameters:
selObject - an EObject, the given process
Returns:
a List, the list of log objects

getLogObjectInNode

public static java.util.List getLogObjectInNode(org.eclipse.emf.ecore.EObject selObject)
Returns a list of log objects in the given node.

Parameters:
selObject - an EObject, the given node
Returns:
a List, the list of log objects

getLogObjectInMonitor

public static java.util.List getLogObjectInMonitor(org.eclipse.emf.ecore.EObject selObject)
Returns a list of log objects in the given monitor.

Parameters:
selObject - an EObject, the given monitor
Returns:
a List, the list of log objects

getLogAgents

public static java.util.Collection getLogAgents(org.eclipse.emf.ecore.EObject eObject,
                                                int type)
Returns the log agents associated with the given object and type of log.

Parameters:
eObject - an EObject, the given object.
type - an int, the type of log (CommonUIConstants.XMI or CommonUIConstants.SQL).
Returns:
a Collection, the log agents.

resolveLogAgentDisplayName

public static java.lang.String resolveLogAgentDisplayName(java.lang.String name)
Parameters:
name -
Returns:
the name to be displayed by the ui

resolveLogAgentType

public static java.lang.String resolveLogAgentType(java.lang.String name)
Parameters:
name -
Returns:
the log agent type

cleanupResources

public static void cleanupResources(java.lang.String navigatorID)
Cleans up the resources for the given navigatorID

Parameters:
navigatorID - a String, the navigator ID

getAgentType

public static void getAgentType(TRCMonitor monitor,
                                java.util.Vector agentTypeList)
Will add the list of agent types, under this monitor, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564

Parameters:
monitor - The monitor that's of interest
agentTypeList - The vector to add the agent types to

getAgentType

public static void getAgentType(TRCNode node,
                                java.util.Vector agentTypeList)
Will add the list of agent types, under this node, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564

Parameters:
node - The node that's of interest
agentTypeList - The vector to add the agent types to

getAgentType

public static void getAgentType(TRCProcessProxy process,
                                java.util.Vector agentTypeList)
Will add the list of agent types, under this process, to the 'agentTypeList' Vector This method was added as a result of bugzilla 158564

Parameters:
process - The process that's of interest
agentTypeList - The vector to add the agent types to

getAgentType

public static java.lang.String getAgentType(TRCAgentProxy agent)

codeLogAgentName

public static java.lang.String codeLogAgentName(java.lang.String type,
                                                java.lang.String name,
                                                java.lang.String userInput)
Parameters:
type -
name -
userInput -
Returns:
a concatenated value stored as the log agent name

resolveLogAgentPath

public static java.lang.String resolveLogAgentPath(java.lang.String name)
Parameters:
name -
Returns:
the log agent path

getProcessName

public static java.lang.String getProcessName(TRCProcessProxy process)
Returns an appropriate label for the given process. Form: processName at hostName [PID: processID]

Parameters:
process - the process element for which to get the label.
Returns:
an appropriate label for the given process.

getLocalPortNumber

public static java.lang.String getLocalPortNumber()
Returns the local port number specified in the AC preference pages

Returns:
local port number specified in the AC preference page that workbench would listen to.

TPTP 4.6.0 Platform Project
Public API Specification