openlsd.database.data.LSDDbService Class Reference
List of all members.
Detailed Description
Class for Service manipulation
- Author:
- Frederic Bregier LGPL
|
Public Member Functions |
| LSDDbService () |
| LSDDbService (long idservice, long idip, int status) |
boolean | get (ResultSet resultSet) |
boolean | getId (ResultSet resultSet) |
boolean | set (LSDDbAdmin admin) |
boolean | set (LSDDbAdmin admin, int status) |
String | toString () |
Static Public Member Functions |
static boolean | del (LSDDbAdmin admin, long idservice) |
static int | del (LSDDbAdmin admin, long idservice, long idip) |
static ArrayList< LSDDbService > | newService (LSDDbAdmin admin, ArrayList< LSDDbIpPort > listIpPort, long idService) |
static ArrayList< LSDDbService > | getServices (LSDDbAdmin admin, long idservice) |
static long | findFirstIndex (LSDDbAdmin admin) |
Public Attributes |
long | idservice = LSDConstants.invalide_idx |
long | idip = LSDConstants.invalide_idx |
int | status = -1 |
Static Public Attributes |
static final String | table = " lsdservice " |
static final String[] | fields |
static final int | ridservice = 0 |
static final int | ridip = 1 |
static final int | rstatus = 2 |
static final String | allfields = " "+fields[ridservice]+","+fields[ridip]+","+fields[rstatus]+" " |
Private Member Functions |
void | assign (long idservice, long idip, int status) |
Static Private Member Functions |
static String | getFieldsSet (int status) |
static String | getFieldsValues (long idservice, long idip, int status) |
static String | getWhereCond (long idservice) |
static String | getWhereCond (long idservice, long idip) |
Static Private Attributes |
static final String | insertfields |
Constructor & Destructor Documentation
openlsd.database.data.LSDDbService.LSDDbService |
( |
|
) |
|
openlsd.database.data.LSDDbService.LSDDbService |
( |
long |
idservice, |
|
|
long |
idip, |
|
|
int |
status | |
|
) |
| | |
Create a Service from args
- Parameters:
-
Member Function Documentation
void openlsd.database.data.LSDDbService.assign |
( |
long |
idservice, |
|
|
long |
idip, |
|
|
int |
status | |
|
) |
| | [private] |
Assign a Service from args
- Parameters:
-
boolean openlsd.database.data.LSDDbService.get |
( |
ResultSet |
resultSet |
) |
|
Get Values from ResultSet
- Parameters:
-
- Returns:
- True if OK, else False
boolean openlsd.database.data.LSDDbService.getId |
( |
ResultSet |
resultSet |
) |
|
Get Only Id from ResultSet
- Parameters:
-
- Returns:
- True if OK, else False
static String openlsd.database.data.LSDDbService.getFieldsSet |
( |
int |
status |
) |
[static, private] |
Get String for Setting as Set
- Parameters:
-
- Returns:
- the string as result
static String openlsd.database.data.LSDDbService.getFieldsValues |
( |
long |
idservice, |
|
|
long |
idip, |
|
|
int |
status | |
|
) |
| | [static, private] |
Get String for Setting as Values
- Parameters:
-
- Returns:
- the string as result
static String openlsd.database.data.LSDDbService.getWhereCond |
( |
long |
idservice |
) |
[static, private] |
Get String for Where Condition for all service with idservice
- Parameters:
-
- Returns:
- the string as result
static String openlsd.database.data.LSDDbService.getWhereCond |
( |
long |
idservice, |
|
|
long |
idip | |
|
) |
| | [static, private] |
Get String for Where Condition for one particular service
- Parameters:
-
- Returns:
- the string as result
boolean openlsd.database.data.LSDDbService.set |
( |
LSDDbAdmin |
admin |
) |
|
Update or Insert if it does not exist. IdService must be OK.
This function should be used only for update.
- Parameters:
-
- Returns:
- True if OK, else False
boolean openlsd.database.data.LSDDbService.set |
( |
LSDDbAdmin |
admin, |
|
|
int |
status | |
|
) |
| | |
Update or Insert data into DB from object. (id must be > invalide_idx)
This function should be used only for update with a new status.
- Parameters:
-
- Returns:
- True if OK, else False
static boolean openlsd.database.data.LSDDbService.del |
( |
LSDDbAdmin |
admin, |
|
|
long |
idservice | |
|
) |
| | [static] |
Del all Services object from the DB associated with the idservice
- Parameters:
-
- Returns:
- True if OK, else False
static int openlsd.database.data.LSDDbService.del |
( |
LSDDbAdmin |
admin, |
|
|
long |
idservice, |
|
|
long |
idip | |
|
) |
| | [static] |
Del the Service object from the DB associated with the idservice and idip
- Parameters:
-
- Returns:
- the number of rows deleted
Create a new Service List from the List of IpPort for the same Service. If the idService passed to the function is KO, try to create a new one (check the value of one of the Service to get this common value). All IpPort for the same service will have the same idService. The List listIpPort is not cleared after this call.
- Parameters:
-
| admin | |
| listIpPort | |
| idService | |
- Returns:
- the list of Service created or if an error occurs null if no Service were added, or a sublist of services created
static ArrayList<LSDDbService> openlsd.database.data.LSDDbService.getServices |
( |
LSDDbAdmin |
admin, |
|
|
long |
idservice | |
|
) |
| | [static] |
Get all Services associated to idservice from DB
- Parameters:
-
- Returns:
- the list of Services or null if an error occurs
static long openlsd.database.data.LSDDbService.findFirstIndex |
( |
LSDDbAdmin |
admin |
) |
[static] |
Find first available Service id for this object. No update are made into the DB.
- Parameters:
-
- Returns:
- The new index if found or LSDConstant.invalide_idx if not found.
String openlsd.database.data.LSDDbService.toString |
( |
|
) |
|
Object to String
- Returns:
- the string that displays this object
- See also:
- java.lang.Object.toString()
Member Data Documentation
Status of this Instance of Service
information for DB manipulation: Table name
Initial value:
{"IDSERVICE","IDIP","STATUS"}
DB field names
DB field for all fields in select command.
Initial value:
DB field for insert
The documentation for this class was generated from the following file:
- OpenLSD/ClientSupport/openlsd/database/data/LSDDbService.java