|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.wst.server.core.ServerUtil
public class ServerUtil
Server utility methods. These static methods can be used to perform common operations on server artifacts.
This class provides all its functionality through static members. It is not intended to be subclassed or instantiated.
Field Summary | |
---|---|
static java.lang.Object |
SERVER_JOB_FAMILY
Constant identifying the job family identifier for server operations. |
Method Summary | |
---|---|
static boolean |
containsModule(IServer server,
IModule module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns true if the given server currently contains the given module. |
static IServer[] |
getAvailableServersForModule(IModule module,
boolean includeErrors,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a list of all servers that this deployable is not currently configured on, but could be added to. |
static IModule |
getModule(org.eclipse.core.resources.IProject project)
Returns the module contained within the given project. |
static IModule |
getModule(java.lang.String moduleId)
Returns the module with the given moduleId, if one exists. |
static IModule[] |
getModules(IModuleType[] moduleTypes)
Return all the available modules from all factories whose type matches the given module types. |
static IModule[] |
getModules(org.eclipse.core.resources.IProject project)
Returns the modules contained within the given project. |
static IModule[] |
getModules(java.lang.String type)
Return all the available modules from all factories whose type matches the given module type id. |
static int |
getMonitoredPort(IServer server,
int port,
java.lang.String contentType)
Returns the port that is being used to monitor the given port on the server. |
static IRuntime[] |
getRuntimes(java.lang.String type,
java.lang.String version)
Return a list of all runtime targets that match the given type and version. |
static IRuntimeType[] |
getRuntimeTypes(java.lang.String type,
java.lang.String version)
Return a list of all runtime types that match the given type and version. |
static IRuntimeType[] |
getRuntimeTypes(java.lang.String type,
java.lang.String version,
java.lang.String runtimeTypeId)
Return a list of all runtime types that match the given type, version, and partial runtime type id. |
static IServer |
getServer(org.eclipse.debug.core.ILaunchConfiguration configuration)
Returns the server associated with the given launch configuration. |
static IServer[] |
getServersByModule(IModule module,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a list of all servers that this module is configured on. |
static org.eclipse.core.runtime.jobs.ISchedulingRule |
getServerSchedulingRule(IServer server)
Returns a scheduling rule to prevent jobs from simultaneously starting, publishing, or stopping the same server. |
static org.eclipse.core.resources.IFile |
getUnusedServerFile(org.eclipse.core.resources.IProject project,
IServer server)
Returns an unused file in the given project. |
static boolean |
isSupportedModule(IModuleType[] moduleTypes,
IModuleType mt)
Returns true if any of the given moduleTypes match the given
module type. |
static boolean |
isSupportedModule(IModuleType[] moduleTypes,
java.lang.String typeId,
java.lang.String versionId)
Returns true if any of the given moduleTypes have the given
module type id and version id. |
static boolean |
isSupportedModule(IModuleType moduleType,
IModuleType mt)
Returns true if the two given module types are compatible. |
static void |
modifyModules(IServerWorkingCopy server,
IModule[] add,
IModule[] remove,
org.eclipse.core.runtime.IProgressMonitor monitor)
Adds or removes modules from a server. |
static void |
setRuntimeDefaultName(IRuntimeWorkingCopy runtime)
Sets a default name on the given runtime. |
static void |
setServerDefaultName(IServerWorkingCopy server)
Sets a default name on the given server. |
static org.eclipse.core.runtime.IStatus |
validateEdit(java.lang.Object context,
IServer server)
Validates whether this server can be editted. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object SERVER_JOB_FAMILY
IJobManager.join(Object, IProgressMonitor)
Method Detail |
---|
public static IModule getModule(org.eclipse.core.resources.IProject project)
This method may trigger bundle loading and is not suitable for short/UI operations.
project
- a project
getModules(IProject)
public static IModule[] getModules(org.eclipse.core.resources.IProject project)
This method may trigger bundle loading and is not suitable for short/UI operations.
project
- a project
getModule(IProject)
public static IModule getModule(java.lang.String moduleId)
This method may trigger bundle loading and is not suitable for short/UI operations.
moduleId
- a module id
null
if the module could not be foundpublic static IModule[] getModules(IModuleType[] moduleTypes)
This method may trigger bundle loading and is not suitable for short/UI operations. It also performs a search of all available modules of the given types, and due to performance reasons should not be used unless absolutely required.
moduleTypes
- an array of module types
public static IModule[] getModules(java.lang.String type)
This method may trigger bundle loading and is not suitable for short/UI operations. It also performs a search of all available modules of this type, and due to performance reasons should not be used unless absolutely required.
type
- a module type
public static boolean isSupportedModule(IModuleType[] moduleTypes, java.lang.String typeId, java.lang.String versionId)
true
if any of the given moduleTypes have the given
module type id and version id.
moduleTypes
- an array of module types, may not be nulltypeId
- a module type id, or null for any module typeversionId
- a module version, or null for any version
true
if the module type is supported, and
false
otherwisepublic static boolean isSupportedModule(IModuleType[] moduleTypes, IModuleType mt)
true
if any of the given moduleTypes match the given
module type.
moduleTypes
- an array of modules types, may not be nullmt
- a module type, may not be null
true
if the module type is supported, and
false
otherwisepublic static boolean isSupportedModule(IModuleType moduleType, IModuleType mt)
moduleType
- a module type, may not be nullmt
- a module type, may not be null
true
if the module type is supported, and
false
otherwisepublic static void modifyModules(IServerWorkingCopy server, IModule[] add, IModule[] remove, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
server
- a serveradd
- an array of modules to add, or null
to not add anyremove
- an array of modules to remove, or null
to not remove anymonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
org.eclipse.core.runtime.CoreException
- if anything goes wrongpublic static void setRuntimeDefaultName(IRuntimeWorkingCopy runtime)
runtime
- a runtimepublic static void setServerDefaultName(IServerWorkingCopy server)
server
- a serverpublic static org.eclipse.core.resources.IFile getUnusedServerFile(org.eclipse.core.resources.IProject project, IServer server)
project
- a projectserver
- a server
public static IRuntime[] getRuntimes(java.lang.String type, java.lang.String version)
type
- a module typeversion
- a module version
IRuntime
public static IRuntimeType[] getRuntimeTypes(java.lang.String type, java.lang.String version)
type
- a module typeversion
- a module version
IRuntimeType
public static IRuntimeType[] getRuntimeTypes(java.lang.String type, java.lang.String version, java.lang.String runtimeTypeId)
type
- a module typeversion
- a module versionruntimeTypeId
- the id of a runtime type
IRuntimeType
public static IServer[] getAvailableServersForModule(IModule module, boolean includeErrors, org.eclipse.core.runtime.IProgressMonitor monitor)
module
- a moduleincludeErrors
- true
to include servers that returned
errors when trying to add the module, and false
otherwisemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
public static IServer[] getServersByModule(IModule module, org.eclipse.core.runtime.IProgressMonitor monitor)
module
- a modulemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
IServer
public static boolean containsModule(IServer server, IModule module, org.eclipse.core.runtime.IProgressMonitor monitor)
server
- a servermodule
- a modulemonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
true
if the module is contained on the server,
or false
otherwisepublic static IServer getServer(org.eclipse.debug.core.ILaunchConfiguration configuration) throws org.eclipse.core.runtime.CoreException
configuration
- a launch configuration
null
if no server could be found
org.eclipse.core.runtime.CoreException
- if there is a problem getting the attribute from
the launch configurationpublic static org.eclipse.core.runtime.IStatus validateEdit(java.lang.Object context, IServer server)
context
- the context (Shell)server
- the server
IStatus.OK
if the server
can be edited, otherwise a status object indicating what when wrong
with the checkoutpublic static int getMonitoredPort(IServer server, int port, java.lang.String contentType)
server
- a serverport
- a port on the servercontentType
- the content type, e.g. "web"
public static org.eclipse.core.runtime.jobs.ISchedulingRule getServerSchedulingRule(IServer server)
server
- a server
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |