public class ClusterServersTableContentProvider extends ListTableContentProvider implements ITransactionalContentProvider, IRefreshableContentProvider
Modifier and Type | Class and Description |
---|---|
class |
ClusterServersTableContentProvider.ServerInfo |
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
fExpireWithPageFlow
Constructor and Description |
---|
ClusterServersTableContentProvider()
Default constructor to use
IClusterProvider.getServer() as the source list
of servers |
Modifier and Type | Method and Description |
---|---|
void |
applyChanges()
Persists changes back to the cluster provider configuration file
|
protected String |
calculateRowId(int index,
Object data)
Make sure server name is used as the rowId
|
void |
cancelChanges()
Cancels all the changes
|
void |
createRow()
Adds server the cluster provider
|
void |
deleteRow()
Removes server from the cluster provider
|
static ClusterServersTableContentProvider |
getClusterServersTableContentProvider() |
boolean |
getNeedRefresh()
Returns
true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh() method. |
String |
getServerFreeMemory() |
long |
getServerNumberOfActiveUsers()
Returns number of users who are not excluding:
- guest
- sysadmin
- Administrator
- WEBM_CLUSTER
- WEBM_SYSTEM
|
long |
getServerNumberOfSessions()
Returns number of ALL sessions on this server
|
IPingInfo |
getServerPingInfo() |
IPingInfo |
getServerPingInfo(IServer server) |
IServer.ServerType |
getServerType() |
String |
getServerURL() |
boolean |
isAutoRefresh()
Returns
true if the provider is currenlty in auto-refresh mode |
boolean |
isServerOnline() |
boolean |
isServerOnline(IServer server) |
boolean |
isThisServer() |
protected IServer |
newRow()
Creates new empty template server instance
|
void |
pingCluster()
Ping the whole cluster
|
void |
pingServer()
Ping selected (currentRow) server
|
void |
pingServer(IServer server) |
void |
refresh()
(Re)loads data from the data source.
|
void |
restartCluster()
Restart the whole cluster one node at a time.
|
void |
restartServer()
Restart selected (currentRow) server
|
void |
setAutoRefresh(boolean autorefresh)
Sets auto refresh mode on.
|
void |
setNeedRefresh(boolean needRefresh)
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any
output property is requested via
IContentProvider.getValue(Object) . |
void |
shutdownCluster()
Shutdown the whole cluster, all nodes at the same time.
|
void |
shutdownServer()
Shutdown selected (currentRow) server
|
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature.
|
calculateRowId, getArray, getCanTemplateRow, getCurrentRow, getList, getOnCreateRow, getOnCreateRowExpression, getOnDeleteRow, getOnDeleteRowExpression, getPropertyKeys, getRowCount, getRowId, getRowIdBinding, getRowIdExpression, getRowIndex, getRowType, getRowVariable, getSort, getType, getValue, hasProperty, isAddressable, isReadOnly, isReorderable, isRowAvailable, isTemplateRow, moveTo, setArray, setCanTemplateRow, setCurrentRow, setList, setOnCreateRow, setOnCreateRowExpression, setOnDeleteRow, setOnDeleteRowExpression, setRowById, setRowId, setRowIdBinding, setRowIdExpression, setRowIndex, setRowType, setRowVariable, setSort, setTemplateRow, setValue, sort, toString
getExpireWithPageFlow, setExpireWithPageFlow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isReadOnly, setValue
getPropertyKeys, getType, getValue, hasProperty, toString
public ClusterServersTableContentProvider()
IClusterProvider.getServer()
as the source list
of serversprotected String calculateRowId(int index, Object data)
calculateRowId
in class ListTableContentProvider
index
- row indexdata
- row data objectprotected IServer newRow()
newRow
in class ListTableContentProvider
public void createRow()
createRow
in interface IUpdateableTableContentProvider
createRow
in class ListTableContentProvider
public void deleteRow()
deleteRow
in interface IUpdateableTableContentProvider
deleteRow
in class ListTableContentProvider
ITableContentProvider.getRowIndex()
public void restartServer() throws Exception
Exception
public void restartCluster() throws Exception
Exception
public void shutdownServer() throws Exception
Exception
public void shutdownCluster() throws Exception
Exception
public void pingServer()
public void pingServer(IServer server)
public boolean isThisServer()
public IServer.ServerType getServerType()
public boolean isServerOnline()
public boolean isServerOnline(IServer server)
public IPingInfo getServerPingInfo()
public long getServerNumberOfSessions()
public long getServerNumberOfActiveUsers()
public String getServerURL()
public String getServerFreeMemory()
public void applyChanges() throws ContentProviderException
applyChanges
in interface ITransactionalContentProvider
ContentProviderException
- if error happens during commitpublic void cancelChanges() throws ContentProviderException
cancelChanges
in interface ITransactionalContentProvider
ContentProviderException
public void refresh() throws ContentProviderException
IRefreshable
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic boolean getNeedRefresh()
IRefreshable
Returns true
when IRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh()
method.
Implementations may return an accurate value from this method if they can track the changes to the input parameter
properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean)
explicitely.
getNeedRefresh
in interface IRefreshable
true
when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh()
needs to be executed manually or automatically.public boolean isAutoRefresh()
IRefreshable
true
if the provider is currenlty in auto-refresh modeisAutoRefresh
in interface IRefreshable
public void setAutoRefresh(boolean autorefresh) throws ContentProviderException
IRefreshable
Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh()
to determine whether the refresh needs to be done before returning any result properties. If it returns
true
, the provider calls IRefreshable.refresh()
method to updated the result properties.
setAutoRefresh
in interface IRefreshable
autorefresh
- true to turn it onContentProviderException
- if auto refresh mode is not supportedIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public void setNeedRefresh(boolean needRefresh)
IRefreshable
IContentProvider.getValue(Object)
.setNeedRefresh
in interface IRefreshable
needRefresh
- true
if the input parameters have changedpublic boolean supportsAutoRefresh()
IRefreshable
supportsAutoRefresh
in interface IRefreshable
IRefreshable.setAutoRefresh(boolean)
public static ClusterServersTableContentProvider getClusterServersTableContentProvider()