Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.xml.types
Class TLptsDBConnectionGroupType

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDBConnectionGroupType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDBConnectionGroupType

public class TLptsDBConnectionGroupType
extends XLptsDBConnectionGroupType

Class Description : This initiates the connection group that keeps a list of all connections in the XML type XLptsDBConnectionGroupType.

This class is not meant to be used by an application, as it is indirectly available through TLptsFactoryConnection.addToConnectionList(com.lapetus_ltd.api.db.control.TLptsConnection), @getConnectionListItem and @getConnectionListItemSize.

$LastChangedRevision: 1165 $
$LastChangedDate:: 2010-11-03 10:37:03#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBConnectionGroupType
connectionListItem, id, title, version
 
Constructor Summary
TLptsDBConnectionGroupType()
           This constructor initiates Connection Group and initialize the statement list and the connection list.
TLptsDBConnectionGroupType(XLptsDBConnectionGroupType connectionGroupType)
           This constructor copies the connection group information from an XLptsDBConnectionGroupType.
 
Method Summary
 void addConnectionListItem(XLptsDBConnectionType connectionType)
           Adds the connection to the connection list.
 void clearConnectionListItem()
           Clears the connection list.
 boolean equals(java.lang.Object obj)
           Check for equal TLptsDBConnectionGroupType objects.
 java.util.List<XLptsDBConnectionType> getConnectionListItem()
           Returns a copy of the actual list.
 int getConnectionListItemSize()
           Returns the size of the actual list.
 void removeConnectionListItem(XLptsDBConnectionType connectionType)
           Removes the connection from the connection list.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBConnectionGroupType
getId, getTitle, getVersion, setId, setTitle, setVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsDBConnectionGroupType

public TLptsDBConnectionGroupType()

This constructor initiates Connection Group and initialize the statement list and the connection list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Default Constructor set id and initialize the statement list and the connection list.

Example :


 TLptsDBConnectionGroupType connectionGroupType = new TLptsDBConnectionGroupType();

 


TLptsDBConnectionGroupType

public TLptsDBConnectionGroupType(XLptsDBConnectionGroupType connectionGroupType)

This constructor copies the connection group information from an XLptsDBConnectionGroupType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this function every time you need to copy or instantiate a type XLptsDBConnectionGroupType class.

Example :


 public void example(XLptsDBConnectionGroupType connectionGroupType)
 {
   TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType(connectionGroupType);
 }

 

Parameters:
connectionGroupType - the class object to copy.
Method Detail

addConnectionListItem

public void addConnectionListItem(XLptsDBConnectionType connectionType)

Adds the connection to the connection list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to add to the list. Getting the list with getConnectionListItem and
then adding does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 TLptsConnection connection = new TLptsConnection();
 cgt.addConnectionListItem(connection);

 

Parameters:
connectionType - the connection to add in the list.

clearConnectionListItem

public void clearConnectionListItem()

Clears the connection list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to clear the list. Getting the list with getConnectionListItem and
then clear does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 if(cgt.getConnectionListItemSize() > 0)
   cgt.clearConnectionListItem();

 


equals

public boolean equals(java.lang.Object obj)

Check for equal TLptsDBConnectionGroupType objects.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to compare two TLptsDBConnectionGroupType objects by there id's.

Example :


 TLptsDBConnectionGroupType cgt1 = new TLptsDBConnectionGroupType();
 TLptsDBConnectionGroupType cgt2 = new TLptsDBConnectionGroupType();
 return cgt1.equals(cgt2);

 

Overrides:
equals in class java.lang.Object
Parameters:
obj - the connection group type
Returns:
true if they are equal, else false.

getConnectionListItem

public java.util.List<XLptsDBConnectionType> getConnectionListItem()

Returns a copy of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not add to this list as there is no result. Use the addConnectionListItem function.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 TLptsConnection connection = new TLptsConnection();
 for(XLptsDBConnectionType con : cgt.getConnectionListItem())
   if(connection.getTitle().equals(con.getTitle()))
     break;

 

Overrides:
getConnectionListItem in class XLptsDBConnectionGroupType
Returns:
Returns a list of connections of this group.

getConnectionListItemSize

public int getConnectionListItemSize()

Returns the size of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not use getConnectionListItem().size() as it is not efficient.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 if(cgt.getConnectionListItemSize() > 0)
   return true;
 else
   return false;

 

Returns:
Returns the number of connections.

removeConnectionListItem

public void removeConnectionListItem(XLptsDBConnectionType connectionType)

Removes the connection from the connection list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to remove from the list. Getting the list with getConnectionListItem and
then removing does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 String connectionTitle = "connection";
 for(XLptsDBConnectionType con : cgt.getConnectionListItem())
   if(con.getTitle().equals(connectionTitle))
   {
     cgt.removeConnectionListItem(con);
     break;
   }

 

Parameters:
connectionType - the connection to remove from list.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)