public class ServerAPI
extends java.lang.Object
Constructor and Description |
---|
ServerAPI() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkAcl(java.lang.String aclName,
java.lang.String userName)
Returns true if the user belongs to a group that is a member of the specified ACL.
|
static java.lang.String[] |
getAuditContext()
Returns the current stack of auditing context IDs.
|
static ContentHandler |
getContentHandler(java.lang.String content_type)
Returns a new ContentHandler for the specified content type.
|
static int |
getCurrentPort()
Returns the port number associated with the current thread of execution.
|
static java.lang.String[] |
getEnabledPackages()
Returns an array of String objects representing all enabled packages.
|
static LogOutputStream |
getLogStream(java.lang.String logfile)
Opens a log file in the server's default logs directory.
|
static java.io.File |
getPackageConfigDir(java.lang.String pkgname)
Returns a File object representing the path name for the given package's configuration directory.
|
static java.lang.String[] |
getPackages()
Returns an array of String objects representing all packages.
|
static java.io.File |
getServerConfigDir()
Returns a File object for the server's config directory.
|
static java.lang.String |
getServerName()
Returns the server's host name.
|
static void |
logError(java.lang.Throwable t)
Logs the specified error to the server's default log file.
|
static void |
logError(Values v)
Logs the specified error to the server's default log file.
|
static void |
registerContentHandler(java.lang.String content_type,
ContentHandlerFactory factory)
Registers a new content-type with the server.
|
static void |
removeContentHandler(java.lang.String content_type)
Deregisters a content type from the server.
|
static void |
sendMail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String body)
Sends an e-mail message to the specified recipient.
|
public static void registerContentHandler(java.lang.String content_type, ContentHandlerFactory factory)
content_type
- A String specifying the new MIME content type to be supported (for example, "text/xml").factory
- A ContentHandlerFactory that will process requests for the new MIME type.ContentHandler
,
ContentHandlerFactory
public static void removeContentHandler(java.lang.String content_type)
content_type
- A String specifying the MIME content type to deregistered.public static ContentHandler getContentHandler(java.lang.String content_type)
content_type
- A String specifying a MIME content-type.public static void logError(java.lang.Throwable t)
t
- A Throwable object specifying the error to be logged.logError(Values)
,
Service.throwError(java.lang.Throwable)
public static void logError(Values v)
v
- A Values object specifying the error to be logged.logError(Throwable)
,
Service.throwError(java.lang.Throwable)
public static LogOutputStream getLogStream(java.lang.String logfile)
logfile
- A String specifying the name of the new log file.public static void sendMail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String body)
to
- A String specifying the recipient of the message.from
- A String specifying the return address.subject
- A String specifying the subject line of the message.body
- A String specifying the body of the message.public static java.io.File getServerConfigDir()
SERVERHOME/config
directory.public static java.io.File getPackageConfigDir(java.lang.String pkgname)
pkgname
- A String specifying the name of the package whose configuration directory is desired.public static java.lang.String[] getPackages()
public static java.lang.String[] getEnabledPackages()
public static java.lang.String getServerName()
public static int getCurrentPort()
InvokeState
public static boolean checkAcl(java.lang.String aclName, java.lang.String userName)
aclName
- A string specifying an ACL nameuserName
- A string specifying a user namepublic static java.lang.String[] getAuditContext()