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 |
logSecurity(java.lang.String message,
boolean success)
Logs a message to the server's security log.
|
static void |
registerCoderForMultipart(java.lang.String serviceName,
java.lang.Class coder)
Registers a service and associated coder for a multipart content handler (ContentHandler_Multipart).
|
static void |
registerContentHandler(java.lang.String content_type,
ContentHandlerFactory factory)
Registers a new content-type with the server.
|
static void |
removeCoderForMultipart(java.lang.String serviceName)
Unregisters the coder for the specified service from multipart content handler.
|
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 registerCoderForMultipart(java.lang.String serviceName, java.lang.Class coder)
serviceName
- The name of the service for which the coder will handle REST requests.
In a REST request URL, the service name appears after “rest” or “restv2” directive. For example,
in the following URL, RestCoderService is the service name: http://localhost:5555/restv2/RestCoderServicecoder
- The derived Type of super class Coder
.public static void removeCoderForMultipart(java.lang.String serviceName)
serviceName
- The name of the service name for which you are unregistering the coder
for the multipart content handler. In a REST request URL, the service name appears after the
“rest” or “restv2” directive.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 void logSecurity(java.lang.String message, boolean success)
logs
directory, or it may be in the ISCoreAudit
database, as configured on the Settings > Logging page of Integration Server Administrator.
This method writes to the security log only if the Security Logger is enabled and
Custom is selected in the Security Areas to Audit on the
Settings > Logging > Edit Security Logger Details page.message
- The message to write to the security log.success
- Indicates whether the action being logged succeeded or failed.
For example, if the client attempts to access a protected resource,
true
indicates the access succeeded and false
indicates the access failed.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()