servicenow.community.soap
Class Instance

java.lang.Object
  extended by servicenow.community.soap.Instance

public class Instance
extends java.lang.Object

Main class in this package. This class contains connection information for a ServiceNow instance, and will also be used cache table definitions. When instantiated, this class will read sys_dictionary and sys_db_object. An exception will be thrown if these tables cannot be read.

Author:
LewisGF

Constructor Summary
Instance(java.util.Properties prop)
          Connect to a ServiceNow instance using values from a Properties object.
Instance(java.lang.String url, java.lang.String username, java.lang.String password)
           
Instance(java.lang.String url, java.lang.String username, java.lang.String password, java.util.Properties prop)
           
 
Method Summary
static org.apache.log4j.Logger getLogger(java.lang.String category)
           
 java.lang.String getProperty(java.lang.String propname)
           
 java.lang.String getURL()
           
 java.lang.String getUserName()
           
 void reportMetrics(org.apache.log4j.Logger logger)
           
 Instance setValidate(boolean validate)
           
 GlideTable table(java.lang.String tablename)
          Returns a GlideTable object which can be used for subsequent interactions with the instance.
 boolean tableExists(java.lang.String tablename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instance

public Instance(java.lang.String url,
                java.lang.String username,
                java.lang.String password,
                java.util.Properties prop)
         throws java.io.IOException
Throws:
java.io.IOException

Instance

public Instance(java.lang.String url,
                java.lang.String username,
                java.lang.String password)
         throws java.io.IOException
Throws:
java.io.IOException

Instance

public Instance(java.util.Properties prop)
         throws java.io.IOException
Connect to a ServiceNow instance using values from a Properties object. The following properties must be defined:

Parameters:
prop -
Throws:
java.io.IOException
Method Detail

getLogger

public static org.apache.log4j.Logger getLogger(java.lang.String category)

getURL

public java.lang.String getURL()

getUserName

public java.lang.String getUserName()

getProperty

public java.lang.String getProperty(java.lang.String propname)

setValidate

public Instance setValidate(boolean validate)

table

public GlideTable table(java.lang.String tablename)
                 throws java.io.IOException,
                        InvalidTableNameException
Returns a GlideTable object which can be used for subsequent interactions with the instance. There is a small amount of overhead in the construction of a GlideTable object because the constructors reads the table definition from the system dictionary. Because of this the instance maintains a cache of all constructed GlideTable objects. This method first checks the cache for a corresponding GlideTable object. If found, it returns the object from the cache. Otherwise it constructs a new object and adds it to the cache.

Parameters:
tablename -
Returns:
GlideTable object
Throws:
java.io.IOException
InvalidTableNameException

tableExists

public boolean tableExists(java.lang.String tablename)
                    throws java.io.IOException
Parameters:
tablename -
Returns:
true if there is a table with this name otherwise false.
Throws:
java.io.IOException

reportMetrics

public void reportMetrics(org.apache.log4j.Logger logger)