All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.services
Class ServiceInitializationObject

    com.sas.services.ServiceInitializationObject

All Implemented Interfaces:
  InitializationObjectInterface, java.io.Serializable

    public class ServiceInitializationObject

implements InitializationObjectInterface

Foundation service's configuration represented as an XML document.

A service's configuration is represented as a UTF-8 encoded XML document. Supported object types are:

- `String`
- `InputSource`

Since:
  1.0
See Also:
  Serialized Form

Constructor Summary
`ServiceInitializationObject()` Constructs a default instance for a service which does not have a configuration.
`ServiceInitializationObject(org.xml.sax.InputSource configXMLInputSource)` Constructs an initialization object initialized with the specified service factory.
`ServiceInitializationObject(java.lang.String configXML)` Constructs an initialization object initialized with the specified service factory.

Method Summary
`void` | `addConfiguration(java.lang.String configName, java.lang.String configXML)` Adds a configuration.
`void` | `addConfigurationDocument(java.lang.String configName, org.w3c.dom.Document document)` Adds a configuration.
`org.w3c.dom.Document` | `createDocument(java.lang.Object config)` Deprecated. Use {`createDocumentFromInputSource(InputSource)` or `createDocumentFromString(String)` instead.
`org.w3c.dom.Document` | `createDocumentFromInputSource(org.xml.sax.InputSource config)` Creates an XML document representation of the service configuration.
`org.w3c.dom.Document` | `createDocumentFromString(java.lang.String config)` Creates an XML document representation of the service configuration.
`AbstractServiceComponentConfig` | `getConfiguration(DocumentServiceConfigAdapterInterface adapter)` Gets a service configuration using the specified adapter to convert XML document to a service configuration.
`java.util.List<ServiceConfigDocument>` | `getConfigurations()` Gets a copy of the collection of the service's configurations.
`java.lang.Object` | `getInitializationObject()` Gets an object used to configure the service.
`void` | `setInitializationObject(java.lang.Object config)` Sets the initialization object.

Constructor Detail

### ServiceInitializationObject

    public ServiceInitializationObject()

  Constructs a default instance for a service which does not have a configuration.

  Use `setInitializationObject(Object)` to specify the service's configuration data.

### ServiceInitializationObject

    public ServiceInitializationObject(java.lang.String configXML)
                                throws ServiceException,
                                       java.lang.IllegalArgumentException

  Constructs an initialization object initialized with the specified service factory.

  Parameters:
    `configXML` - Initialization data or `null` if the service does not have any configuration data.
  Throws:
    `ServiceException` - if unable to create a configuration.
    `java.lang.IllegalArgumentException` - if invalid XML is specified.
  See Also:
    `ServiceInitializationObject(InputSource)`

### ServiceInitializationObject

    public ServiceInitializationObject(org.xml.sax.InputSource configXMLInputSource)
                                throws ServiceException,
                                       java.lang.IllegalArgumentException

  Constructs an initialization object initialized with the specified service factory.

  Parameters:
    `configXMLInputSource` - Initialization data or `null` if the service does not have any configuration data.
  Throws:
    `ServiceException` - if unable to create a configuration.
    `java.lang.IllegalArgumentException` - if an invalid input source is specified.
  See Also:
    `ServiceInitializationObject(String)`

Method Detail

### createDocument

    public final org.w3c.dom.Document createDocument(java.lang.Object config)
                                              throws InitializationException

  Deprecated. Use {`createDocumentFromInputSource(InputSource)` or `createDocumentFromString(String)` instead.

  Creates an XML document representation of the service configuration.

  Parameters:
    `config` - A `String` or `InputSource` that represents a service's XML configuration.
  Returns:
    XML document representation of the service's configuration.
  Throws:
    `InitializationException`

### createDocumentFromString

    public final org.w3c.dom.Document createDocumentFromString(java.lang.String config)
                                                        throws InitializationException

  Creates an XML document representation of the service configuration.

  Parameters:
    `config` - A `String` that represents a service's XML configuration.
  Returns:
    XML document representation of the service's configuration.
  Throws:
    `InitializationException`

### createDocumentFromInputSource

    public final org.w3c.dom.Document createDocumentFromInputSource(org.xml.sax.InputSource config)
                                                             throws InitializationException

  Creates an XML document representation of the service configuration.

  Parameters:
    `config` - An `InputSource` that represents a service's XML configuration.
  Returns:
    XML document representation of the service's configuration.
  Throws:
    `InitializationException`

### setInitializationObject

    public final void setInitializationObject(java.lang.Object config)
                                       throws InitializationException

  Sets the initialization object.

  Parameters:
    `config` - Configuration from which an XML document will be obtained that represents a service's configuration. A service's configuration is represented as a UTF-8 encoded XML document.

    Supported object types are:

    - `String`
    - `InputSource`
  Throws:
    `InitializationException` - if an invalid object is specified.

### addConfiguration

    public final void addConfiguration(java.lang.String configName,
                                       java.lang.String configXML)
                                throws InitializationException

  Adds a configuration.

  Parameters:
    `configName` - Service configuration's name.
    `configXML` - XML service configuration.
  Throws:
    `InitializationException`

### addConfigurationDocument

    public final void addConfigurationDocument(java.lang.String configName,
                                               org.w3c.dom.Document document)
                                        throws InitializationException

  Adds a configuration.

  Parameters:
    `configName` - Service configuration's name.
    `document` - XML document that represents the service's configuration.
  Throws:
    `InitializationException`

### getInitializationObject

    public final java.lang.Object getInitializationObject()

  Gets an object used to configure the service.

  Specified by:
    `getInitializationObject` in interface `InitializationObjectInterface`
  Returns:
    Service's initialization data.

### getConfigurations

    public final java.util.List<ServiceConfigDocument> getConfigurations()

  Gets a copy of the collection of the service's configurations.

  Returns:
    Collection of the service's configurations. Each list element will be of type `ServiceConfigDocument`.

### getConfiguration

    public final AbstractServiceComponentConfig getConfiguration(DocumentServiceConfigAdapterInterface adapter)
                                                          throws ServiceException

  Gets a service configuration using the specified adapter to convert XML document to a service configuration.

  Parameters:
    `adapter` - Adapter used to translate an XML document into a service configuration.
  Returns:
    Service configuration or `null` if a configuration is not defined.
  Throws:
    `ServiceException` - if unable to create a configuration.

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.