SilverStream
Application Server 3.5

com.sssw.srv.api
Interface AgiDatabase

All Superinterfaces:
AgiAdmChanges, AgiAdmContainer, AgiAdmContainerBase, AgiAdmDatabase, AgiAdmElement, AgiAdmElementBase, AgiAdmPropertyBag, AgiDatabaseConnection, AgiInvokeBusinessObject

public interface AgiDatabase
extends AgiAdmDatabase, AgiDatabaseConnection, AgiInvokeBusinessObject

Server-side interface that represents a database. This interface extends AgiAdmDatabase and adds some public methods. It provides access to other server-side objects such as AgiTables and allows the programmer to invoke business objects and create URLs for Servlets.

This interface is implemented by objects representing individual databases on a server. They can be obtained from AgiServer objects using the getChildren() and getDatabase() methods, or from Business Objects by calling evt.getDatabase() on any business object event. An Enumeration of AgiDatabase objects representing all databases on the server can be obtained by calling AgiServer.getDatabases().

See Also:
AgiServer

Fields inherited from interface com.sssw.rts.adminapi.AgiAdmDatabase
DATABASE, DB_SILVERSTREAM, PROP_DBDRIVER, PROP_DBNAME, PROP_DBPASSWD, PROP_DBUSER, PROP_ISSHADOWED, PROP_JDBCDRIVER, PROP_JDBCURL, PROP_JDBCURLATTR, PROP_LDSKEY, PROP_MAX_CONNS, PROP_MIN_CONNS, PROP_SDBDRIVER, PROP_SDBNAME, PROP_SDBPASSWD, PROP_SDBUSER, PROP_SJDBCDRIVER, PROP_SJDBCURL, PROP_SJDBCURLATTR, PROP_SLDSKEY, PROP_SMAX_CONNS, PROP_SMIN_CONNS, PROP_TABLE_LIST_NAMES, PROP_TABLE_LIST_PATTERNS
 
Fields inherited from interface com.sssw.rts.adminapi.AgiAdmContainer
GET_CHILDREN_EX, GET_CHILDREN_NTDOMAINS_PRIMARY_ONLY, GET_CHILDREN_NTDOMAINS_TRUSTED_ONLY, GET_CHILDREN_SORTED, GET_CHILDREN_WITH_INFO
 
Fields inherited from interface com.sssw.rts.adminapi.AgiAdmElement
ACL_KEY, APPLY_TO_DESC, APPLY_TO_DESC_SUPPORTED, DIRECTORY_LIST_SECURITY, GET_PERMS_AS_ACL, GET_PERMS_DEFAULT, PROP_CERTIFICATE, PROP_DESCRIPTION, PROP_DOMAIN, PROP_FULL_NAME, PROP_IS_LOCKSMITH, PROP_LDAP_SERVER, PROP_NAME, PROP_NISPLUS_SERVER, PROP_PARENT_URL, PROP_PASSWORD, PROP_QUAL_NAME, PROP_TYPE, PROP_URL, REQUIRE_LOGIN, REQUIRE_LOGIN_SUPPORTED
 
Fields inherited from interface com.sssw.rts.adminapi.AgiAdmContainerBase
GET_CHILDREN_DFLT
 
Method Summary
 String createServletResource(String url, String businessObjectName)
          Creates a ServletResource (URL) in this database.
 com.sssw.srv.agents.AgoUUID createUserContentResource(String url, String mimeTypeStr, String busObjName)
          Creates a new AgoUserContentResource for the specified URL.
 String getName()
          Returns the name of this database
 com.sssw.srv.agents.AgoUserContentResource getResourceFromURL(String url)
          Obtains the AgoUserContentResource with the specified URL.
 com.sssw.srv.agents.AgoUserContentResource getResourceFromUUID(com.sssw.srv.agents.AgoUUID uuid)
          Obtains the AgoUserContentResource with the specified AgoUUID
 AgiTable getTable(String name)
          Returns an AgiTable object allowing access to individual tables You must specify the name of a table within this database.
 Enumeration getTables()
          Return an enumeration of objects implementing AgiTable representing all non-system tables in database.
 Serializable invokeAgent(String name)
          Deprecated. as of SilverStream Version 2.0. Use AgiInvokeBusinessObject.invokeBusinessObject(String), which can throw any Exception thrown by the business object's invoked event.
 Serializable invokeAgent(String name, Serializable param)
          Deprecated. as of SilverStream version 2.0. Use AgiInvokeBusinessObject.invokeBusinessObject(String, Serializable), which can throw any Exception thrown by the business object's invoked event.
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmDatabase
analyzeTableListChanges, commitTableListChanges, getTableSubset, synchronizeSchema
 
Methods implemented from interface com.sssw.srv.api.AgiDatabaseConnection
getConnection, getConnectionCount, getUnallocatedConnectionCount, releaseConnection
 
Methods implemented from interface com.sssw.rt.util.AgiInvokeBusinessObject
invokeBusinessObject, invokeBusinessObject
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmElement
getPermissions, getServerURL, getURL, getVariables, isAuthorized, setPermissions
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmContainerBase
addChild, getChild, getChildren
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmElementBase
delete, getType
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmPropertyBag
getProperties, getProperty, setProperties, setProperty
 
Methods implemented from interface com.sssw.rts.adminapi.AgiAdmChanges
cancelChanges, saveChanges
 

Method Detail

getName

public String getName()
Returns the name of this database
Specified by:
getName in interface AgiAdmElementBase
Example:

This example gets the name of the database that a business object is in.

     String dbName = evt.getDatabase().getName();
 

getTable

public AgiTable getTable(String name)
Returns an AgiTable object allowing access to individual tables You must specify the name of a table within this database.
Parameters:
name - name of a table in this database to return an AgiTable for
Returns:
the AgiTable object or null on an error
Example:
     AgiTable myTable = evt.getDatabase().getTable("myTable");
 

getTables

public Enumeration getTables()
Return an enumeration of objects implementing AgiTable representing all non-system tables in database.
Example:
       Enumeration tables = evt.getDatabase().getTables();
       while (tables.hasMoreElements()) {
           AgiTable table = (AgiTable)tables.nextElement();
           // do something with the table
       }
 

invokeAgent

public Serializable invokeAgent(String name,
                                Serializable param)
                         throws AgoUnrecoverableSystemException,
                                IOException
Deprecated. as of SilverStream version 2.0. Use AgiInvokeBusinessObject.invokeBusinessObject(String, Serializable), which can throw any Exception thrown by the business object's invoked event.

Invoke an agent and pass it an argument. Starting in SilverStream version 2.0 this is a business object listening for invoked events.
Parameters:
name - full name (including package) of an agent (business object) to invoke. The agent should be in the same database. To call an agent in a different database on the same server prepend the name of the database and a ":" to the name.
param - (optional) a parameter to pass to the agent (business object)
Throws:
IOException - is not thrown by this implementation but is thrown by the version available to clients via agGeneral.
Usage:

The method returns a result as set by the agent via AgoInvokedEvent.setResult().

See Also:
AgiInvokeBusinessObject.invokeBusinessObject( String agentSpec ), AgiInvokeBusinessObject.invokeBusinessObject( String agentSpec, Serializable param ), AgoInvokedEvent.setResult( Serializable, String ), AgoInvokedEvent.setResult( Serializable )

invokeAgent

public Serializable invokeAgent(String name)
                         throws AgoUnrecoverableSystemException,
                                IOException
Deprecated. as of SilverStream Version 2.0. Use AgiInvokeBusinessObject.invokeBusinessObject(String), which can throw any Exception thrown by the business object's invoked event.

Invoke an agent. Starting in SilverStream version 2.0 this is a business object listening for invoked events.
Parameters:
name - full name (including package) of an agent (business object) to invoke. The agent should be in the same database. To call an agent in a different database on the same server prepend the name of the database and a ":" to the name
Throws:
IOException - is not thrown by this implementation but is thrown by the version available to clients via agGeneral.
See Also:
AgiInvokeBusinessObject.invokeBusinessObject( String agentSpec ), AgiInvokeBusinessObject.invokeBusinessObject( String agentSpec, Serializable param ), AgoInvokedEvent.setResult(Serializable, String), AgoInvokedEvent.setResult(Serializable)

createServletResource

public String createServletResource(String url,
                                    String businessObjectName)
                             throws AgoUnrecoverableSystemException,
                                    IOException
Creates a ServletResource (URL) in this database.
Parameters:
url - URL in String form relative to this database (should not begin with '/')
businessObjectName - the fully qualified class name (including package) of the servlet to call to process requests received by this resource.
Returns:
the full absolute URL of the new resource as a String
Usage:

If the URL has more than one component, all intervening components are created as container resources.

Example:

This is an example of an invoked business object creating an URL that is passed in as a String parameter to the business object

     AgiDatabase db = evt.getDatabase();
     db.createServletResource((String)evt.getParameter(), "myServlet");
 

createUserContentResource

public com.sssw.srv.agents.AgoUUID createUserContentResource(String url,
                                                             String mimeTypeStr,
                                                             String busObjName)
                                                      throws AgoUnrecoverableSystemException
Creates a new AgoUserContentResource for the specified URL.
Parameters:
url - the URl to create
mimeTypeStr - the MIME Type of the URL
busObjName - name of the Servlet this resource should call.
Returns:
The UUID of the newly created resource.
Throws:
AgentException - if there are any errors.
Usage:

If the URL has more than one component, all intervening components are created as container resources. The URL should be relative (that is, it should not begin with a /) to the webbase of the business object.


getResourceFromUUID

public com.sssw.srv.agents.AgoUserContentResource getResourceFromUUID(com.sssw.srv.agents.AgoUUID uuid)
                                                               throws com.sssw.srv.agents.AgoUnknownResourceException,
                                                                      com.sssw.srv.agents.AgoInvalidResourceException
Obtains the AgoUserContentResource with the specified AgoUUID
Parameters:
uuid -  
Returns:
the resource of the specified URL
Usage:
  • This method exists for compatibility for SilverStream version 1.0 agents. All new code should use Servlets and ServletResources. See createServletResource(). Servlet resources don't expose their UUIDs so this method should not be needed.
  • In SilverStream version 1.0 this method used the baseURL that a UserContentAgent keeps internally and was set via setBaseURL(). Specifically, the baseURL was prepended to all URLs passed into this method that did NOT begin with a / (i.e., that were not server relative). Since Servlets do not keep a baseURL as UserContentAgents used to, this functionality must be coded in the routines that call this method.

getResourceFromURL

public com.sssw.srv.agents.AgoUserContentResource getResourceFromURL(String url)
                                                              throws com.sssw.srv.agents.AgoUnknownResourceException,
                                                                     com.sssw.srv.agents.AgoInvalidResourceException
Obtains the AgoUserContentResource with the specified URL.
Parameters:
url - the URL of the resource to get in String form relative to this database (should not begin with '/').
Returns:
The resource of the specified URL
Usage:
  • This method exists for compatibility for SilverStream version 1.0 agents. All new code should use Servlets and ServletResources. See createServletResource(). Servlet resources don't expose their UUIDs so this method should not be needed.
  • In SilverStream version 1.0 this method used the baseURL that a UserContentAgent keeps internally and was set via setBaseURL(). Specifically, the baseURL was prepended to all URLs passed into this method that did NOT begin with a / (i.e., that were not server relative). Since Servlets do not keep a baseURL as UserContentAgents used to, this functionality must be coded in the routines that call this method.

SilverStream
Application Server 3.5