|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.management.domain.Server
A Server is a managed iFS application.
An application following the the Server pattern can be managed by iFS administration tools. This allows it to be started on an iFS node and dynamically monitored and tuned.
Agents and protocol servers are two types of Server. An agent is an
application that runs unattended and performs some operation, either
periodically or in response to an IfsEvent. A protocol server opens
a java.net.ServerSocket
, awaits connections from clients,
and performs operations dictated by a protocol specification in response
to client requests.
To create a server, you can write a concrete subclass of this Server class. An easier approach, however, is to subclass IfsServer, which provides default implementations for methods, and provides tools for easily writing a thread-safe event-driven or timer-driven application.
Field Summary | |
static int |
LEVEL_HIGH
Verbose logging. |
static int |
LEVEL_LOW
Minimal logging. |
static int |
LEVEL_MEDIUM
Typical logging (the default). |
static int |
LEVEL_OFF
Logging disabled. |
Fields inherited from interface oracle.ifs.management.domain.ServerInterface |
SERVERSTATUS_DISPOSED, SERVERSTATUS_RUNNING, SERVERSTATUS_STARTING, SERVERSTATUS_STOPPED, SERVERSTATUS_STOPPING, SERVERSTATUS_SUSPENDED, SERVERSTATUS_UNKNOWN |
Constructor Summary | |
Server()
Constructs a Server. |
Method Summary | |
protected void |
deregister()
Deregisters this Server. |
Credential |
getCredential(java.lang.String name)
Gets a Credential for the specified user. |
java.lang.String |
getName()
Gets the name of this Server. |
java.lang.String |
getNodeName()
Gets the name of the node for this Server. |
java.lang.String |
getOracleHome()
Gets the Oracle home directory for this Server's node. |
ParameterTable |
getParameterTable()
Gets the configuration parameters for this Server. |
java.lang.String |
getServiceName()
Gets the name of the default service for this Server. |
void |
initialize()
Initializes this Server. |
void |
initialize(java.lang.String name,
java.lang.String serviceName,
java.lang.String schemaPassword,
ParameterTable parameterTable,
java.io.PrintWriter logWriter,
int logLevel)
Initializes this Server (standalone). |
boolean |
isLogged(int level)
Gets whether calling log with the specified logging
level would cause a message to be logged. |
void |
log(int level,
java.lang.String message)
Logs the specified message. |
void |
log(int level,
java.lang.String message,
java.lang.Throwable throwable)
Logs the specified message and throwable, as a single log entry. |
void |
log(int level,
java.lang.Throwable throwable)
Logs the specified throwable. |
static java.lang.String |
toStatusLabel(int status)
Gets a localized label for the specified status of a Server, using the default Localizer. |
static java.lang.String |
toStatusLabel(int status,
LibrarySessionInterface session)
Gets a localized label for the specified status of a Server, using the specified session's Localizer. |
static java.lang.String |
toStatusLabel(int serverStatus,
Localizer localizer)
Gets a localized label for the specified status of a Server, using the specified Localizer. |
protected void |
verifyNotDisposed()
Verifies this Server has not been disposed. |
Methods inherited from interface oracle.ifs.management.domain.ServerInterface |
dispose, getPriority, getProperties, getProperty, getServerType, getStatus, isAgent, isPropertyReadonly, restart, resume, setPriority, setProperty, start, stop, supportsPriority, supportsSuspendResume, suspend |
Field Detail |
public static final int LEVEL_OFF
public static final int LEVEL_LOW
public static final int LEVEL_MEDIUM
public static final int LEVEL_HIGH
Constructor Detail |
public Server() throws IfsException
Subclasses should provide a zero-argument constructor.
IfsException
- (IFS-45200) if the operation failsMethod Detail |
public final void initialize(java.lang.String name, java.lang.String serviceName, java.lang.String schemaPassword, ParameterTable parameterTable, java.io.PrintWriter logWriter, int logLevel) throws IfsException
This method should be called only when testing a Server outside the domain administration framework, that is, when the Server is not running on an iFS node. For such a standalone Server, call this method immediately after the Server is constructed.
Because they cannot be managed by the domain administration framework, standalone Servers should be used for test purposes only.
name
- the name of the ServerserviceName
- the name of the default service used
by this Server; this service must be
already startedschemaPassword
- the schema password for this serviceparameterTable
- the Server configuration parameterslogWriter
- the PrintWriter used for logging; if
null, log output is sent to System.outlogLevel
- the desired logging levelIfsException
- (IFS-45201) if the operation failspublic void initialize() throws java.lang.Exception
This method is called when the Server is first loaded. Unless overridden, no operation is performed.
If this method throws an exception, loading of the Server is aborted.
java.lang.Exception
- if the operation failspublic final ParameterTable getParameterTable() throws IfsException
The configuration parameters are provided by the iFS node in loading the Server, and are immutable.
IfsException
- (IFS-45202) if the operation failspublic final Credential getCredential(java.lang.String name) throws IfsException
A TokenCredential is returned. In this way, this Server can obtain a valid Credential for any iFS user without that user's password.
The generated TokenCredential is valid for one use or 60 seconds, whichever comes first.
name
- the user nameIfsException
- (IFS-45206) if the operation failspublic final java.lang.String getNodeName() throws IfsException
IfsException
- (IFS-45209) if the operation failspublic java.lang.String getOracleHome() throws IfsException
The Oracle home directory is specified by the node's
IFS.DOMAIN.NODE.OracleHome
parameter.
(For standalone Servers, the Oracle home directory
is specified by the server's parameter named
IFS.DOMAIN.NODE.OracleHome
.)
IfsException
- (IFS-45208) if the operation failspublic void log(int level, java.lang.String message)
level
- the minimum logging level for the
message to be loggedmessage
- the messagepublic void log(int level, java.lang.Throwable throwable)
level
- the minimum logging level for the
message to be loggedthrowable
- the throwablepublic void log(int level, java.lang.String message, java.lang.Throwable throwable)
level
- the minimum logging level for the
message to be loggedmessage
- the messagethrowable
- the throwablepublic boolean isLogged(int level)
log
with the specified logging
level would cause a message to be logged.level
- the logging levelprotected final void verifyNotDisposed() throws IfsException
The getStatus
method is called to check
the status of this Server.
Invoking methods on a disposed Server (other than
getStatus
, getName
and
deregister
) is illegal and should throw
an exception. Call this method to perform that check.
IfsException
- (IFS-45203) if this Server has been disposedprotected final void deregister() throws IfsException
Call this method upon disposing this Server to remove it from the list of Servers for the iFS node.
IfsException
- (IFS-45205) if the operation failspublic java.lang.String getName() throws IfsException
getName
in interface ServerInterface
IfsException
- (IFS-45160) if the operation failspublic java.lang.String getServiceName() throws IfsException
getServiceName
in interface ServerInterface
IfsException
- (IFS-45175) if the operation failspublic static java.lang.String toStatusLabel(int status) throws IfsException
Equivalent to toStatusLabel(status, Localizer.getDefault())
.
status
- the statusIfsException
- if the operation failspublic static java.lang.String toStatusLabel(int status, LibrarySessionInterface session) throws IfsException
Equivalent to toStatusLabel(status, session.getLocalizer())
.
status
- the statussession
- the sessionIfsException
- if the operation failspublic static java.lang.String toStatusLabel(int serverStatus, Localizer localizer) throws IfsException
If localizer
is null, this method is equivalent to
toStatusLabel(status, new Localizer())
.
status
- the statuslocalizer
- the LocalizerIfsException
- if the operation fails
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |