|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.session.SessionServiceInitObject
public final class SessionServiceInitObject
Session Service configuration which may specify the default user context to associate with the root session context and optionally a session context timeout.
This service provides the capability to update its configuration by merging another configuration, so long as no conflicts exist. The following table documents what can be merged and constraints which must be satisfied in order for a merge to be accepted.
Item | Constraints |
---|---|
user context name | This value can be updated if the current value is undefined. |
timeout | This value can be updated if the current value is undefined. |
Field Summary |
---|
Fields inherited from class com.sas.services.AbstractServiceComponentConfig |
---|
ENCODING, LOOKUPKEY_PROPERTYNAME_VIEWCLASS, PROPERTY_NAME_INIT_DATA, PROPERTY_NAME_INITIALIZATIONDATA, PROPERTYROLE_APPCONFIG, PROPERTYROLE_INITIALIZATION, XML_ELEMENT_ATTRIBUTE_VERSION |
Constructor Summary | |
---|---|
SessionServiceInitObject()
Constructs a default instance of a session service configuration. |
|
SessionServiceInitObject(java.io.InputStream configInputStream)
Constructs an instance which will be initialized with the service configuration read from the specified input stream. |
|
SessionServiceInitObject(java.lang.String defaultUser)
Constructs an instance of a session service configuration using the specified user context name. |
Method Summary | |
---|---|
Consumer |
addConsumer(Consumer consumer,
boolean isConsumer)
Adds the consumer to the usage model specifying its use of defined service configuration resources. |
org.w3c.dom.DocumentFragment |
appendDOM(org.w3c.dom.Document document)
Appends elements to the specified XML document representing the Session Service component's configuration. |
protected org.w3c.dom.DocumentFragment |
appendDOM(org.w3c.dom.Document document,
AbstractServiceComponentConfig serviceConfig)
Constructs a document object model representing the configuration data for a foundation user service. |
static org.w3c.dom.DocumentFragment |
appendDOM(org.w3c.dom.Document document,
SessionServiceInitObject serviceConfig)
Appends elements to the specified XML document representing the Session Service component's configuration. |
static java.lang.Long |
convertMinutesToMsec(java.lang.Long minutes)
Converts from minutes to msec. |
protected AbstractServiceComponentConfig |
createConfiguration(org.w3c.dom.Document document)
Creates a service configuration initialized with the specified XML document. |
boolean |
equals(java.lang.Object o)
Determines whether or not the specified object is equivalent to this object. |
protected AbstractServiceComponentConfig |
getConfig(org.w3c.dom.Document serviceConfigDocument)
Gets an object representing the service's configuration data obtained from the specified XML document. |
java.lang.String |
getConfirmDeleteUnusedResourceMsg(ConsumedResourceInterface consumedResource)
Gets a localized message which can be used in a confirmation dialog that is presented to notify the user the specified unused resource will be deleted. |
java.lang.String |
getConfirmDeleteUnusedResourcesMsg()
Gets a localized message which can be used in a confirmation dialog that is presented to notify the user that unused resources will be deleted. |
protected java.lang.String |
getServiceFactoryClassName()
Gets the session service factory's fully-qualified Java class name. |
java.lang.Long |
getSessionContextTimeout()
Get session context timeout value in units of msec. |
java.lang.Long |
getSessionContextTimeoutMinutes()
Get session context timeout value in units of minutes. |
java.lang.String |
getUserContextName()
Get default platform user context name. |
int |
hashCode()
Gets the hash code. |
protected void |
mergeConfiguration(AbstractServiceComponentConfig currentConfig,
AbstractServiceComponentConfig newConfig)
Merges the new user service configuration into the current configuration. |
protected void |
mergeConfiguration(AbstractServiceComponentConfig currentConfig,
AbstractServiceComponentConfig newConfig,
MergePolicy mergePolicy)
Merges the new user service configuration into the current configuration. |
Consumer |
removeConsumer(Consumer consumer,
boolean isRemoveResourceIfUnused)
Removes the consumer from the usage model. |
void |
setIsConsumer(Consumer consumer,
boolean isConsumer)
Specifies consumer use of all of the the service configuration's resources. |
void |
setSessionContextTimeout(java.lang.Long sessionContextTimeoutMsec)
Sets session context timeout given a value in units of msec. |
void |
setSessionContextTimeoutMinutes(java.lang.Long sessionContextTimeoutMinutes)
Sets session context timeout given a value in units of minutes. |
void |
setUserContextName(java.lang.String defaultUserContextName)
Sets the default user context name. |
protected void |
validateServiceConfigurationCustom(org.w3c.dom.Document document)
Determines whether the service configuration is valid for this service component. |
Constructor Detail |
---|
public SessionServiceInitObject()
public SessionServiceInitObject(java.io.InputStream configInputStream) throws java.lang.IllegalArgumentException
The input stream must designate a resource that contains a UTF-8 encoded Logging Service configuration such as one that has been exported by the Foundation Services Manager plug-in to the SAS Management Console.
configInputStream
- An input stream to a UTF-8 encoded XML document used to represent the
service component's configuration.
java.lang.IllegalArgumentException
- if an invalid URL is specified.public SessionServiceInitObject(java.lang.String defaultUser)
defaultUser
- The default platform user context name. This identifies
the name of the user context to be used by the root session
context.Method Detail |
---|
protected AbstractServiceComponentConfig createConfiguration(org.w3c.dom.Document document) throws ServiceException
createConfiguration
in class AbstractServiceComponentConfig
document
- XML describing the service's configuration.
configuration
initialized
from the the XML document.
ServiceException
- if unable to create a configuration.public java.lang.String getConfirmDeleteUnusedResourcesMsg()
Overrides the default message to say that the session context timeout and user context name will be reset to their default values.
getConfirmDeleteUnusedResourcesMsg
in class AbstractServiceComponentConfig
public java.lang.String getConfirmDeleteUnusedResourceMsg(ConsumedResourceInterface consumedResource)
Overrides the super-class implementation with a message that says the unused JAAS login configuration name will be reset to its default value.
getConfirmDeleteUnusedResourceMsg
in class AbstractServiceComponentConfig
consumedResource
- The consumed resource which is being removed.
public void setUserContextName(java.lang.String defaultUserContextName)
defaultUserContextName
- Default user context name.public java.lang.String getUserContextName()
String
that is the default Platform user context
name.public void setSessionContextTimeout(java.lang.Long sessionContextTimeoutMsec)
sessionContextTimeoutMsec
- The timeout value, in units of msec, used to destroy stale session contexts.
Specify null
to indicate that the session context will
not be timed out.public void setSessionContextTimeoutMinutes(java.lang.Long sessionContextTimeoutMinutes)
sessionContextTimeoutMinutes
- The timeout value, in units of minutes, used to destroy stale session contexts.public static java.lang.Long convertMinutesToMsec(java.lang.Long minutes)
minutes
- Minutes or null
.
null
timeout is specified, then -1 will be returned.public java.lang.Long getSessionContextTimeout()
Long
the session context timeout in units of msec.
A null
indicates no timeout.public java.lang.Long getSessionContextTimeoutMinutes()
Long
the session context timeout in units of minutes.
A null
indicates no timeout.protected void validateServiceConfigurationCustom(org.w3c.dom.Document document) throws ServiceConfigurationException
validateServiceConfigurationCustom
in class AbstractServiceComponentConfig
document
- XML document that represents a service's configuration.
ServiceConfigurationException
public org.w3c.dom.DocumentFragment appendDOM(org.w3c.dom.Document document)
appendDOM
in class AbstractServiceComponentConfig
document
- XML document which is to be constructed by appending
elements representing the Session Service configuration.
public static org.w3c.dom.DocumentFragment appendDOM(org.w3c.dom.Document document, SessionServiceInitObject serviceConfig)
document
- XML document which is to be constructed by appending
elements representing the Session Service configuration.serviceConfig
- The Session Service configuration which is to be
added to the XML document.
protected java.lang.String getServiceFactoryClassName()
getServiceFactoryClassName
in class AbstractServiceComponentConfig
SessionServiceFactory
public Consumer removeConsumer(Consumer consumer, boolean isRemoveResourceIfUnused) throws ServiceException
removeConsumer
in class AbstractServiceComponentConfig
consumer
- Consumer whose configuration is to be removed.isRemoveResourceIfUnused
- true
if the service configuration's resources should
be removed if they are no longer used by any consumers. The session
context timeout and user context name will be defaulted if this
parameter is set to true
and the resource no longer used
by any consumers.
null
.
ServiceException
- if an error occurs while attempting to remove the consumer.protected void mergeConfiguration(AbstractServiceComponentConfig currentConfig, AbstractServiceComponentConfig newConfig) throws ServiceConfigurationException, java.lang.IllegalArgumentException
mergeConfiguration
in class AbstractServiceComponentConfig
currentConfig
- The current configuration into which the new
configuration is to be merged.newConfig
- The new configuration which is to be merged into the
current configuration.
ServiceConfigurationException
- if unable to merge the service
configuration.
java.lang.IllegalArgumentException
- if a null
current or new
configuration is specified.protected void mergeConfiguration(AbstractServiceComponentConfig currentConfig, AbstractServiceComponentConfig newConfig, MergePolicy mergePolicy) throws ServiceConfigurationException, java.lang.IllegalArgumentException
mergeConfiguration
in class AbstractServiceComponentConfig
currentConfig
- The current configuration into which the new
configuration is to be merged.newConfig
- The new configuration which is to be merged into the
current configuration.mergePolicy
- Policy which specifies how to merge service configurations.
ServiceConfigurationException
- if unable to merge the service
configuration.
java.lang.IllegalArgumentException
- if a null
current or new
configuration is specified.public Consumer addConsumer(Consumer consumer, boolean isConsumer)
This class overrides the superclass's implementation to clear the is consumed flag if any of the following service configuration resources are undefined.
addConsumer
in class AbstractServiceComponentConfig
consumer
- The consumer to be added to the usage model.isConsumer
- true
if the consumer uses all of the service configuration's resources
false
if it uses none.
public void setIsConsumer(Consumer consumer, boolean isConsumer)
This class overrides the superclass's implementation to clear the is consumed flag if any of the following service configuration resources are undefined.
setIsConsumer
in class AbstractServiceComponentConfig
consumer
- The consumer.isConsumer
- true
if the consumer uses all of the service configuration's resources or
false
otherwise.protected AbstractServiceComponentConfig getConfig(org.w3c.dom.Document serviceConfigDocument) throws ServiceConfigurationException, java.lang.IllegalArgumentException
getConfig
in class AbstractServiceComponentConfig
serviceConfigDocument
- Service configuration represented as an XML
document.
ServiceConfigurationException
- if unable to obtain a configuration
from the specified XML document.
java.lang.IllegalArgumentException
- if a null
document is
specified.protected org.w3c.dom.DocumentFragment appendDOM(org.w3c.dom.Document document, AbstractServiceComponentConfig serviceConfig) throws ServiceConfigurationException, java.lang.IllegalArgumentException
appendDOM
in class AbstractServiceComponentConfig
document
- XML document to which the service's configuration is to be
appended.serviceConfig
- Service configuration which is to be converted to an
XML document.
null
since no child document fragments are to be
added to the document.
ServiceConfigurationException
- if unable to create an XML
representation of the service's configuration.
java.lang.IllegalArgumentException
- if a null
document or
service configuration is specified.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Object to be compared for equality.
true
if the object is a SessionServiceInitObject
and the default user context names are equivalent.public int hashCode()
hashCode
in class java.lang.Object
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |