Search in sources :

Example 1 with SBimServerInfo

use of org.bimserver.interfaces.objects.SBimServerInfo in project BIMserver by opensourceBIM.

the class AdminServiceImpl method getBimServerInfo.

@Override
public SBimServerInfo getBimServerInfo() throws ServerException, UserException {
    requireAdminOrMonitorAuthentication();
    SBimServerInfo bimServerInfo = new SBimServerInfo();
    SVersion version = getBimServer().getVersionChecker().getLocalVersion();
    SVersion latestVersion = getBimServer().getVersionChecker().getOnlineVersion();
    SDatabaseInformation databaseInformation = getDatabaseInformation();
    bimServerInfo.setCurrentVersion(version.getFullString());
    bimServerInfo.setCurrentDate(version.getDate());
    if (latestVersion != null) {
        bimServerInfo.setLatestVersion(latestVersion.getMajor() + "." + latestVersion.getMinor() + "." + latestVersion.getRevision());
        bimServerInfo.setLatestDate(latestVersion.getDate());
    }
    bimServerInfo.setCheckouts(databaseInformation.getNumberOfCheckouts());
    bimServerInfo.setRevisions(databaseInformation.getNumberOfRevisions());
    bimServerInfo.setUsers(databaseInformation.getNumberOfUsers());
    bimServerInfo.setProjects(databaseInformation.getNumberOfProjects());
    bimServerInfo.setSchemaVersion(databaseInformation.getSchemaVersion());
    bimServerInfo.setServerLogUrl(getBimServer().getServerSettingsCache().getServerSettings().getSiteAddress() + "/download?token=" + getServiceMap().getAuthorization().asHexToken(getBimServer().getEncryptionKey()) + "&action=getfile&type=serverlog");
    bimServerInfo.setStarted(getServerStartTime());
    return bimServerInfo;
}
Also used : SBimServerInfo(org.bimserver.interfaces.objects.SBimServerInfo) SDatabaseInformation(org.bimserver.interfaces.objects.SDatabaseInformation) SVersion(org.bimserver.interfaces.objects.SVersion)

Aggregations

SBimServerInfo (org.bimserver.interfaces.objects.SBimServerInfo)1 SDatabaseInformation (org.bimserver.interfaces.objects.SDatabaseInformation)1 SVersion (org.bimserver.interfaces.objects.SVersion)1