Search in sources :

Example 1 with ServerStatus

use of com.gitblit.models.ServerStatus in project gitblit by gitblit.

the class StatusPanel method updateTable.

protected void updateTable(boolean pack) {
    ServerStatus status = gitblit.getStatus();
    header.setText(Translation.get("gb.status"));
    version.setText(Constants.NAME + (status.isGO ? " GO v" : " WAR v") + status.version);
    releaseDate.setText(status.releaseDate);
    bootDate.setText(status.bootDate.toString() + " (" + Translation.getTimeUtils().timeAgo(status.bootDate) + ")");
    url.setText(gitblit.url);
    servletContainer.setText(status.servletContainer);
    ByteFormat byteFormat = new ByteFormat();
    heapMaximum.setText(byteFormat.format(status.heapMaximum));
    heapAllocated.setText(byteFormat.format(status.heapAllocated));
    heapUsed.setText(byteFormat.format(status.heapAllocated - status.heapFree) + " (" + byteFormat.format(status.heapFree) + " " + Translation.get("gb.free") + ")");
    tableModel.setProperties(status.systemProperties);
    tableModel.fireTableDataChanged();
}
Also used : ByteFormat(com.gitblit.utils.ByteFormat) ServerStatus(com.gitblit.models.ServerStatus)

Example 2 with ServerStatus

use of com.gitblit.models.ServerStatus in project gitblit by gitblit.

the class RpcTests method testServerStatus.

@Test
public void testServerStatus() throws Exception {
    ServerStatus status = RpcUtils.getStatus(url, account, password.toCharArray());
    assertNotNull("No status was retrieved!", status);
}
Also used : ServerStatus(com.gitblit.models.ServerStatus) Test(org.junit.Test)

Example 3 with ServerStatus

use of com.gitblit.models.ServerStatus in project gitblit by gitblit.

the class RpcUtils method getStatus.

/**
 * Retrieves the server status object.
 *
 * @param serverUrl
 * @param account
 * @param password
 * @return an ServerStatus object
 * @throws IOException
 */
public static ServerStatus getStatus(String serverUrl, String account, char[] password) throws IOException {
    String url = asLink(serverUrl, RpcRequest.LIST_STATUS);
    ServerStatus status = JsonUtils.retrieveJson(url, ServerStatus.class, account, password);
    return status;
}
Also used : ServerStatus(com.gitblit.models.ServerStatus)

Aggregations

ServerStatus (com.gitblit.models.ServerStatus)3 ByteFormat (com.gitblit.utils.ByteFormat)1 Test (org.junit.Test)1