|
Oracle Fusion Middleware Oracle WebLogic Server API Reference 12c Release 1 (12.1.1) Part Number E24391-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweblogic.cluster.singleton.QueryHelper
public abstract class QueryHelper
Helper class for ClusterMaster to determine servers that are unresponsive and to find lease owners. Queries for lease management. Each lease has an associated timeout which is calculated as (SYSDATE - TIMEOUT). TIMEOUT is initially caclulated as an absolute time in the future (ie. SYSDATE + interval), without renewal TIMEOUT will eventually be in the past and SYSDATE - TIMEOUT will become positive.
Field Summary | |
---|---|
static String |
TIME_AS_FRACTION_OF_DAY
|
Constructor Summary | |
---|---|
QueryHelper()
|
|
QueryHelper(String tableName,
String domainName,
String clusterName,
int dbType)
|
Method Summary | |
---|---|
protected abstract String |
addToDate(String date,
int seconds)
Returns an sql snippet that adds the specifed number of seconds to the date value. |
protected abstract String |
compareDates(String date1,
String date2)
Returns an sql snippet that compares the two specified dates. |
protected abstract String |
compareDates(String date1,
String date2,
boolean includeEquality)
Returns an sql snippet that compares the two specified dates. |
String |
getAbdicateLeaseQuery(String leaseName,
String owner)
Returns a query that removes lease from database, regardless of if it is expired or not. |
String |
getAcquireLeaseQuery(String leaseName,
String owner)
Returns a query that tries to delete any timed-out leases associated with this name. |
String |
getAssumeLeaseQuery(String leaseName,
String owner,
int leaseTimeout)
Returns a query that tries to insert a new lease into the database with the given lease name and timeout period. |
protected int |
getDBType()
|
String |
getDeleteMachineQuery(String serverName,
String machineTableName)
Returns a query that disassociates a server from a machine in the given table |
String |
getInsertMachineQuery(String serverName,
String hostMachine,
String machineTableName)
Returns a query that associates a server with a machine in the given table |
String |
getLeaseOwnerQuery(String leaseName)
Returns a query that returns the owner of the provided lease |
String |
getPreviousLeaseOwnerQuery(String leaseName)
Returns the current/last owner of the provided lease, regardless of whether it has expired or not. |
String |
getRenewAllLeasesQuery(String owner,
int leaseTimeout)
Returns a query that updates all the leases in database owned by 'owner' to be valid until 'timeoutPeriod' seconds pass. |
String |
getRenewLeaseQuery(String leaseName,
String owner,
int leaseTimeout)
Returns a query that updates the provided lease to be valid until 'timeoutPeriod' seconds pass |
String |
getRenewLeasesQuery(String owner,
Set leaseNames,
int leaseTimeout)
Returns a query that updates the provided leases to be valid until 'timeoutPeriod' seconds pass |
String |
getRetrieveMachineQuery(String serverName,
String machineTableName)
Returns a query that finds the machine associated with the given server name |
protected abstract String |
getTimeFunction()
Returns a query that returns the current time & date, down to at least seconds precision. |
String |
getUnresponsiveMigratableServersQuery(int gracePeriod)
Returns a query that returns a list of server names that failed to renew their lease. |
protected void |
init(String tableName,
String domainName,
String clusterName,
int dbType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String TIME_AS_FRACTION_OF_DAY
Constructor Detail |
---|
public QueryHelper(String tableName, String domainName, String clusterName, int dbType)
public QueryHelper()
Method Detail |
---|
protected void init(String tableName, String domainName, String clusterName, int dbType)
protected abstract String addToDate(String date, int seconds)
date
- date variable to add toseconds
- number of seconds to add to column
protected abstract String compareDates(String date1, String date2)
date1
- date2
-
protected abstract String compareDates(String date1, String date2, boolean includeEquality)
date1
- date2
- includeEquality
- protected abstract String getTimeFunction()
protected int getDBType()
public String getLeaseOwnerQuery(String leaseName)
leaseName
- name of lease
public String getPreviousLeaseOwnerQuery(String leaseName)
leaseName
- name of lease
public String getAcquireLeaseQuery(String leaseName, String owner)
leaseName
- name of leaseowner
- server who is the owner as a transient identity string
public String getAssumeLeaseQuery(String leaseName, String owner, int leaseTimeout)
leaseName
- name of leaseowner
- server who is the owner as a transient identity stringleaseTimeout
- period after which the lease will timeout in
seconds from now
public String getRenewLeaseQuery(String leaseName, String owner, int leaseTimeout)
leaseName
- name of leaseowner
- server who is the owner as a transient identity stringleaseTimeout
- period after which the lease will expire in
seconds from now
public String getRenewLeasesQuery(String owner, Set leaseNames, int leaseTimeout)
owner
- server who is the owner as a transient identity stringleaseNames
- name of leasesleaseTimeout
- period after which the lease will expire in
seconds from now
public String getRenewAllLeasesQuery(String owner, int leaseTimeout)
owner
- server who is the owner of the leases as a transient
identity stringleaseTimeout
- period after which the lease will expire in
seconds from now
public String getAbdicateLeaseQuery(String leaseName, String owner)
leaseName
- name of leaseowner
- server who is the owner as a transient identity
string
public String getUnresponsiveMigratableServersQuery(int gracePeriod)
gracePeriod
- amount of time to wait after a lease expires
before the server is migrated, in seconds
public String getInsertMachineQuery(String serverName, String hostMachine, String machineTableName)
serverName
- name of serverhostMachine
- name of the machine
public String getDeleteMachineQuery(String serverName, String machineTableName)
serverName
- name of servermachineTableName
- table to delete from
public String getRetrieveMachineQuery(String serverName, String machineTableName)
serverName
- name of servermachineTableName
- table to perform the lookup in
|
Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Oracle WebLogic Server API Reference 12c Release 1 (12.1.1) Part Number E24391-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |