|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.wst.server.core.ServerUtil
Server utility methods. These static methods can be used to perform common operations on server artifacts.
Method Summary | |
---|---|
static boolean |
containsModule(IServer server,
IModule module,
IProgressMonitor monitor)
Returns true if the given server currently contains the given module. |
static IServer[] |
getAvailableServersForModule(IModule module,
boolean includeErrors,
IProgressMonitor monitor)
Returns a list of all servers that this deployable is not currently configured on, but could be added to. |
static IModule |
getModule(java.lang.String moduleId)
Returns a module from the given moduleId. |
static IModule[] |
getModules(IProject project)
Returns the project modules attached to a project. |
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(ILaunchConfiguration configuration)
Returns the server associated with the given launch configuration. |
static IServer[] |
getServersByModule(IModule module,
IProgressMonitor monitor)
Returns a list of all servers that this module is configured on. |
static IFile |
getUnusedServerFile(IProject project,
IServerType type)
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,
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 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 |
Method Detail |
public static IModule[] getModules(IProject project)
project
- a project
public static IModule getModule(java.lang.String moduleId)
moduleId
- a module id
null
if the module could not be foundpublic 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 typestypeId
- a module typeversionId
- a module 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 typesmt
- a module type
true
if the module type is supported, and
false
otherwisepublic static boolean isSupportedModule(IModuleType moduleType, IModuleType mt)
moduleType
- a module typemt
- a module type
true
if the module type is supported, and
false
otherwisepublic static void modifyModules(IServerWorkingCopy server, IModule[] add, IModule[] remove, IProgressMonitor monitor) throws 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
CoreException
public static void setRuntimeDefaultName(IRuntimeWorkingCopy runtime)
runtime
- a runtimepublic static void setServerDefaultName(IServerWorkingCopy server)
server
- a serverpublic static IFile getUnusedServerFile(IProject project, IServerType type)
project
- a projecttype
- a server type
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, 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, 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, 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(ILaunchConfiguration configuration) throws CoreException
configuration
- a launch configuration
null
if no server could be found
CoreException
- if there is a problem getting the attribute from
the launch configurationpublic static 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 checkout
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |