com.sybase.persistence
Class ConnectionProfile

java.lang.Object
  extended by com.sybase.persistence.ConnectionProfile

public class ConnectionProfile
extends java.lang.Object


Field Summary
protected  ConnectionProfile __syncProfile
           
protected  java.lang.Object __wrapperData
           
 
Constructor Summary
ConnectionProfile()
          Construct a ConnectionProfile instance.
ConnectionProfile(java.lang.String name)
          Construct a ConnectionProfile instance with the specified profile name.
 
Method Summary
 void delete()
          Delete the file saved by Save() method.
static ConnectionProfile find(java.lang.String name)
          Construct a ConnectionProfile object by searching file content.
 void fromSyncConnection(Connection conn)
          Set properties values based on conn parameter.
 boolean getBoolean(java.lang.String name)
          Get a boolean value of connection property by name.
 boolean getBoolean(java.lang.String name, boolean defaultValue)
          Get a boolean value of connection property by name.
 int getCacheSize()
          get the property value of cacheSize
 java.lang.String getDomainName()
          get the property value of domainName
 int getInt(java.lang.String name)
          Get an int value of connection property by name.
 int getInt(java.lang.String name, int defaultValue)
          Get an int value of connection property by name.
 java.lang.String getName()
          Returns the profile name.
 java.lang.String getNetworkProtocol()
          get the property value of mobiLinkStreamType
 java.lang.String getNetworkStreamParams()
          get the property value of mobiLinkStreamParams
 int getPageSize()
          get the property value of pageSize
 java.lang.String getPassword()
          get the property value of password
 int getPortNumber()
          get the property value of mobiLinkPort
 java.lang.String getProperty(java.lang.String name)
          Get connection property value by name.
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Get connection property value by name.
 java.lang.String getRequiredProperty(java.lang.String name)
          Get connection property value by name.If not found, throws out a PersistenceException.
 java.lang.String getServerName()
          get the property value of mobiLinkHost
 java.lang.String getString(java.lang.String name)
          Get a property's string value
 java.lang.String getStringWithDefault(java.lang.String name, java.lang.String defaultValue)
          Get a string property's value.
 ConnectionProfile getSyncProfile()
          Get the synchronization profile
 java.lang.String getUserName()
          get the property value of userName
 java.lang.Object getWrapperData()
          Sybase internal use only.
 ConnectionProfile initSyncProfile(ConnectionProfile _syncProfile)
          Sybase internal use only.
 ConnectionProfile initWrapperData(java.lang.Object _wrapperData)
          Sybase internal use only.
static ConnectionProfile load(java.lang.String name)
          Construct a ConnectionProfile object by searching file content.
 void save()
          Save the connection profile information to the file.
 void setCacheSize(int cacheSize)
          set the property value of cacheSize
 void setDefault(java.lang.String name, java.lang.String value)
          Set a property value if the property does not exist.
 void setDomainName(java.lang.String domainName)
          set the property value of domainName
 void setEncryptionKey(java.lang.String value)
          Set value for encryptionKey property.
 void setName(java.lang.String name)
          Set the profile name.
 void setNetworkProtocol(java.lang.String mobiLinkStreamType)
          set the property value of mobiLinkStreamType
 void setNetworkStreamParams(java.lang.String mobiLinkStreamParams)
          set the property value of mobiLinkStreamParams
 void setPageSize(int pageSize)
          set the property value of pageSize
 void setPassword(java.lang.String value)
          set new value to password connection property..
 void setPortNumber(int mobiLinkPort)
          set the property value of mobiLinkPort
 void setProperty(java.lang.String name, java.lang.String value)
          Set new value to a property
 void setServerName(java.lang.String mobiLinkHost)
          set the property value of mobiLinkHost
 void setString(java.lang.String name, java.lang.String value)
          Set new string value to a property
 void setSyncProfile(ConnectionProfile _syncProfile)
          Set the synchronization profile
 void setUserName(java.lang.String value)
          set new value to userName connection property.
 void setWrapperData(java.lang.Object _wrapperData)
          Sybase internal use only.
 Connection toSyncConnection()
          Return a Connection instance from ConnectionProfile properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__syncProfile

protected ConnectionProfile __syncProfile

__wrapperData

protected java.lang.Object __wrapperData
Constructor Detail

ConnectionProfile

public ConnectionProfile()
Construct a ConnectionProfile instance.


ConnectionProfile

public ConnectionProfile(java.lang.String name)
Construct a ConnectionProfile instance with the specified profile name.

Method Detail

find

public static ConnectionProfile find(java.lang.String name)
Construct a ConnectionProfile object by searching file content.

Parameters:
name - file name which contains connection profile information
Returns:
An instance of ConnectionProfile if found, otherwise return null.

load

public static ConnectionProfile load(java.lang.String name)
Construct a ConnectionProfile object by searching file content.

Parameters:
name - file name which contains connection profile information
Returns:
An instance of ConnectionProfile if found, otherwise throw out an ObjectNotFoundException.

save

public void save()
Save the connection profile information to the file.


delete

public void delete()
Delete the file saved by Save() method.


getName

public java.lang.String getName()
Returns the profile name.


getProperty

public java.lang.String getProperty(java.lang.String name)
Get connection property value by name.

Parameters:
name - profile property name.

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    java.lang.String defaultValue)
Get connection property value by name.

Parameters:
name - property name
defaultValue - property default value

getRequiredProperty

public java.lang.String getRequiredProperty(java.lang.String name)
Get connection property value by name.If not found, throws out a PersistenceException.

Parameters:
name - property name

getBoolean

public boolean getBoolean(java.lang.String name)
Get a boolean value of connection property by name. Default to false.


getBoolean

public boolean getBoolean(java.lang.String name,
                          boolean defaultValue)
Get a boolean value of connection property by name. Default to defaultValue.


getInt

public int getInt(java.lang.String name)
Get an int value of connection property by name.


getInt

public int getInt(java.lang.String name,
                  int defaultValue)
Get an int value of connection property by name. If property is not found, return the specified default value.


setName

public void setName(java.lang.String name)
Set the profile name.


setDefault

public void setDefault(java.lang.String name,
                       java.lang.String value)
Set a property value if the property does not exist.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Set new value to a property


setString

public void setString(java.lang.String name,
                      java.lang.String value)
Set new string value to a property


getString

public java.lang.String getString(java.lang.String name)
Get a property's string value


getStringWithDefault

public java.lang.String getStringWithDefault(java.lang.String name,
                                             java.lang.String defaultValue)
Get a string property's value. If not found, return the default value provided.


setEncryptionKey

public void setEncryptionKey(java.lang.String value)
Set value for encryptionKey property.


getSyncProfile

public ConnectionProfile getSyncProfile()
Get the synchronization profile


setSyncProfile

public void setSyncProfile(ConnectionProfile _syncProfile)
Set the synchronization profile


initSyncProfile

public ConnectionProfile initSyncProfile(ConnectionProfile _syncProfile)
Sybase internal use only.


initWrapperData

public ConnectionProfile initWrapperData(java.lang.Object _wrapperData)
Sybase internal use only.


getWrapperData

public java.lang.Object getWrapperData()
Sybase internal use only.


setWrapperData

public void setWrapperData(java.lang.Object _wrapperData)
Sybase internal use only.


setUserName

public void setUserName(java.lang.String value)
set new value to userName connection property.


setPassword

public void setPassword(java.lang.String value)
set new value to password connection property..


getUserName

public java.lang.String getUserName()
get the property value of userName


getPassword

public java.lang.String getPassword()
get the property value of password


getNetworkProtocol

public java.lang.String getNetworkProtocol()
get the property value of mobiLinkStreamType


setNetworkProtocol

public void setNetworkProtocol(java.lang.String mobiLinkStreamType)
set the property value of mobiLinkStreamType


getNetworkStreamParams

public java.lang.String getNetworkStreamParams()
get the property value of mobiLinkStreamParams


setNetworkStreamParams

public void setNetworkStreamParams(java.lang.String mobiLinkStreamParams)
set the property value of mobiLinkStreamParams


getServerName

public java.lang.String getServerName()
get the property value of mobiLinkHost


setServerName

public void setServerName(java.lang.String mobiLinkHost)
set the property value of mobiLinkHost


getPortNumber

public int getPortNumber()
get the property value of mobiLinkPort


setPortNumber

public void setPortNumber(int mobiLinkPort)
set the property value of mobiLinkPort


getDomainName

public java.lang.String getDomainName()
get the property value of domainName


setDomainName

public void setDomainName(java.lang.String domainName)
set the property value of domainName


getPageSize

public int getPageSize()
get the property value of pageSize


setPageSize

public void setPageSize(int pageSize)
set the property value of pageSize


getCacheSize

public int getCacheSize()
get the property value of cacheSize


setCacheSize

public void setCacheSize(int cacheSize)
set the property value of cacheSize


toSyncConnection

public Connection toSyncConnection()
Return a Connection instance from ConnectionProfile properties.


fromSyncConnection

public void fromSyncConnection(Connection conn)
Set properties values based on conn parameter.