SilverStream
Application Server 3.5

com.sssw.rts.adminapi
Interface AgiAdmContainerBase

All Known Subinterfaces:
AgiAdmCluster, AgiAdmClusterServer, AgiAdmContainer, AgiAdmDatabase, AgiAdmDirectory, AgiAdmGroup, AgiAdmLBClusterEnv, AgiAdmLBContainer, AgiAdmServer, AgiAdmStatContainer, AgiDatabase, AgiServer

public interface AgiAdmContainerBase

Implemented by objects that contain other items. Servers, databases, directories, and groups are containers. AgiAdmContainerBase defines the basic container functionality, which is refined by its subclasses.


Field Summary
static int GET_CHILDREN_DFLT
          Defines the default mode for the getChildren method.
 
Method Summary
 void addChild(String name, String type, Hashtable props)
          Add a child object to the container.
 AgiAdmElementBase getChild(String name, String type, Hashtable info)
          Get an object that is a child of the container.
 Enumeration getChildren(int options)
          Enumerates the children of the container.
 

Field Detail

GET_CHILDREN_DFLT

public static final int GET_CHILDREN_DFLT
Defines the default mode for the getChildren method. The default specifies to return the container children enumerated the way the server does it, with no alterations to the list.
Method Detail

addChild

public void addChild(String name,
                     String type,
                     Hashtable props)
              throws AgoUnrecoverableSystemException,
                     AgoSecurityException
Add a child object to the container.
Parameters:
name - the name of the child
type - the type of the child
props - additional properties describing the child, if any
Returns:
none
Usage:

Refer to the following for the type parameter:

Refer to the following for the props parameter: Refer to the following for server element properties AgiAdmServer.
  • Database Connection Properties
  • Load Balancing Properties
  • Security Settings
    • NIS+ Properties
    • LDAP and LDAP Group Properties
    • Other Security Settings
  • Server Logging Properties
  • Server Cache Management Properties
  • Server Port Properties
  • Other Server Properties

Adding a database

When adding a database to the server, note the following about which properties are required:

  • PROP_DBNAME: Not required; the name of the database is supplied with the name parameter of addChild.
  • PROP_DBUSER: Required.
  • PROP_DBPASSWD: Required.
  • PROP_JDBCURL: Required only if the driver set is a non-SilverStream driver set.
  • PROP_JDBCURLATTR: Required only if the driver set is a non-SilverStream driver set and when there's an attributes value that is needed to be passed in in accordance with the specifics of the database type
  • PROP_JDBCDRIVER: Not required.
  • PROP_LDSKEY: Required. This is the important field providing the information about the connection type, since the LDS key uniquely identifies the database platform and the driver set that are to be used for the database.
  • PROP_DBDRIVER: Not required.
  • PROP_MIN_CONNS: Not required.
  • PROP_MAX_CONNS: Not required.
  • PROP_ISSHADOWED: Required only if the database is being added with a "shadow" database, i.e. its system tables are to be stored in a separate database.
  • PROP_SDBNAME: Required only if the value of PROP_ISSHADOWED is Boolean.TRUE, i.e. the user chose to "split" their database and store the system tables in the separate, "shadow" database -- whose name this property specifies.
  • PROP_SDBUSER: Same as for PROP_SDBNAME.
  • PROP_SDBPASSWD: Same as for PROP_SDBNAME.
  • PROP_SJDBCURL: Required only in the shadowed case and if the connection type is non-SilverStream
  • PROP_SJDBCURLATTR: Same as for PROP_SJDBCURL.
  • PROP_SJDBCDRIVER: Not required.
  • PROP_SLDSKEY: Required only in the shadowed case.
  • PROP_SDBDRIVER: Not required.
  • PROP_SMAX_CONNS: Not required.
  • PROP_TABLE_LIST_NAMES: Required only if the user wants to specify a list of tables that are to be used in SilverStream, and exclude the other tables from being used.
  • PROP_TABLE_LIST_PATTERNS: Required only if the user wants to specify a list of table name patterns which resolve to the list of tables that are to be used in SilverStream, and exclude the other tables from being used

See the examples below.

Example:
 // a) Add the database 'Silver' to server 'myServer'
 // Get to the Server Admin object
 AgiAdmServer server = AgAdmin.getServer("myServer", -1);
 Hashtable childProps = new Hashtable();
 // Specify the database user parameter
 childProps.put(AgiAdmDatabase.PROP_DBUSER, "dba");
 // Specify the password parameter
 childProps.put(AgiAdmDatabase.PROP_DBPASSWD, "sql");
 // Specify the JDBC URL parameter (it's optional and is needed only if the connection type is 
 // non-SilverStream)
 childProps.put(AgiAdmDatabase.PROP_JDBCURL, 
   "jdbc:sybase:Tds:pancake:2638/?SERVICENAME=MainDB");
 // Specify the JDBC URL attributes, if any (this is optional and is needed only if the connection type
 // is non-SilverStream)
 childProps.put(AgiAdmDatabase.PROP_JDBCURLATTR, "cache=100");
 // Specify the logical data source key
 childProps.put(AgiAdmDatabase.PROP_LDSKEY, "SybAdaptiveV6JConnect5");
 // Add the database to the server
 server.addChild("Silver", AgiAdmDatabase.DATABASE, childProps);
 
 //b) Add the database "myDB" to server "myServer", 
 // with the system tables stored in a separate database "myDB2"
 // Get to the Server Admin object
 AgiAdmServer server = AgAdmin.getServer("myServer", -1);
 Hashtable childProps = new Hashtable();
 // Specify the database user parameter
 childProps.put(AgiAdmDatabase.PROP_DBUSER, "dba");
 // Specify the password parameter
 childProps.put(AgiAdmDatabase.PROP_DBPASSWD, "sql");
 // Specify the logical data source key
 childProps.put(AgiAdmDatabase.PROP_LDSKEY, "SybAdaptiveV6AgBridge");
 // We'll be storing the system tables in a separate database
 childProps.put(AgiAdmDatabase.PROP_ISSHADOWED, new Boolean(true));
 // Specify the name of the "shadow" database
 childProps.put(AgiAdmDatabase.PROP_SDBNAME, "myDB2");
 // Specify the db user for the "shadow" database
 childProps.put(AgiAdmDatabase.PROP_SDBUSER, "dba");
 // Specify the db user password for the "shadow" database
 childProps.put(AgiAdmDatabase.PROP_SDBPASSWD, "sql");
 // Specify the LDS key for the "shadow" database
 childProps.put(AgiAdmDatabase.PROP_SLDSKEY, "SybSQLAnyV5AgBridge");
 // Add the database to the server
 server.addChild("myDB", AgiAdmDatabase.DATABASE, childProps);
 
 	// c) add a SilverUser to a group
 	AgiAdmServer server = ...
 	AgiAdmGroup group = (AgiAdmGroup)server.getElement(
 		"myGroup", AgiAdmGroup.SILVERGROUP, null);
 	group.addChild("user1", AgiAdmUser.SILVERUSER, null);
 
 	// d) add an NT user to the group
 	Hashtable info = new Hashtable();
 	info.put(AgiAdmElement.PROP_DOMAIN, "brilliant");
 	group.addChild("brilliant\\testuser", AgiAdmUser.NTUSER, info);
 

getChild

public AgiAdmElementBase getChild(String name,
                                  String type,
                                  Hashtable info)
                           throws AgoUnrecoverableSystemException,
                                  AgoSecurityException
Get an object that is a child of the container.
Parameters:
name - the name of the child
type - the type of the child
info - additional properties describing the child, if any
Usage:
The current implementation of the API does NOT check whether the specified child is in fact an existing child of the container; the method works merely as an object factory.

For information concerning the type and info parameters, see the list of types and properties for addChild.


getChildren

public Enumeration getChildren(int options)
                        throws AgoUnrecoverableSystemException,
                               AgoSecurityException
Enumerates the children of the container. A "child" is an item that the container holds.
Parameters:
options - the options for enumerating the children
Returns:
The enumeration of child objects.
Usage:

At each level of the API object hierarchy, containers may hold different types of children. The API users can use the instanceof operator and/or the AgiAdmElementBase.getType() method to find out what type of entity each of the children is.

For a list of values for the options parameter, see AgiAdmContainer.

Example:
 // get a reference to AgiAdmServer
 AgiAdmServer server = ...
 
 // a) get an unsorted list of databases (children of server)
 Enumeration e = server.getChildren(AgiAdmContainerBase.GET_CHILDREN_DFLT);
 
 // b) get a sorted list of forms residing in the Forms directory
 Hashtable info = new Hashtable();
 info.put(AgiAdmServer.INFO_DATABASE_NAME, "myDatabase");
 AgiAdmDirectory formsDir = (AgiAdmDirectory)server.getElement(
 	AgiAdmDirectory.FORMS, AgiAdmDirectory.FORMS, info);
 Enumeration e = formsDir.getChildren(AgiAdmContainer.GET_CHILDREN_SORTED);
 
 AgiAdmDirectory ntSecurity = (AgiAdmDirectory)server.getElement(
 	AgiAdmDirectory.NT_SECURITY, AgiAdmDirectory.NT_SECURITY, null);
 // c) get the list of primary NT domains
 Enumeration primary = ntSecurity.getChildren(
 	AgiAdmContainer.GET_CHILDREN_NTDOMAINS_PRIMARY_ONLY);
 // d) get the list of trusted domains (sorted)
 Enumeration trusted = ntSecurity.getChildren(
 	AgiAdmContainer.GET_CHILDREN_NTDOMAINS_TRUSTED_ONLY | AgiAdmContainer.GET_CHILDREN_SORTED);
 
 // e) get the list of NT groups in an NT domain with all the group properties
 // (this may be slow)
 Hashtable info = new Hashtable();
 info.put(AgiAdmElement.PROP_DOMAIN, "brilliant");
 AgiAdmDirectory ntGroupsDir = (AgiAdmDirectory)server.getElement(
 	AgiAdmDirectory.NTGROUPS, AgiAdmDirectory.NTGROUPS, info);
 Enumeration ntGroups = ntGroupsDir.getChildren(AgiAdmContainer.GET_CHILDREN_WITH_INFO);
 
+ *

SilverStream
Application Server 3.5