use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class InumService method containsAppliance.
public boolean containsAppliance(String inum, String gluuInum) {
GluuAppliance appliance = new GluuAppliance();
appliance.setBaseDn(String.format("inum=%s,ou=appliances,o=gluu", inum));
return ldapEntryManager.contains(appliance);
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class InumService method containsServer.
public boolean containsServer(String inum, String gluuInum) {
GluuAppliance appliance = new GluuAppliance();
appliance.setBaseDn(String.format("inum=%s,ou=servers,o=gluu", inum));
return ldapEntryManager.contains(appliance);
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class ApplianceStatusTest method testIsApplianceStatus1.
@Test
public void testIsApplianceStatus1() throws Exception {
GluuAppliance appliance = applianceService.getAppliance();
Date currentDateTime = new Date();
appliance.setLastUpdate(currentDateTime);
applianceService.updateAppliance(appliance);
assertEquals(applianceStatusAction.checkHealth(), OxTrustConstants.RESULT_SUCCESS);
assertEquals(applianceStatusAction.getHealth(), "OK");
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class ApplianceStatusTest method testIsApplianceStatus2.
@Test(dependsOnMethods = { "testIsApplianceStatus1" })
public void testIsApplianceStatus2() throws Exception {
GluuAppliance appliance = applianceService.getAppliance();
long currentTime = System.currentTimeMillis() - 50 * 1000;
Date currentDateTime = new Date(currentTime);
appliance.setLastUpdate(currentDateTime);
applianceService.updateAppliance(appliance);
assertEquals(applianceStatusAction.checkHealth(), OxTrustConstants.RESULT_SUCCESS);
assertEquals(applianceStatusAction.getHealth(), "OK");
}
use of org.gluu.oxtrust.model.GluuAppliance in project oxTrust by GluuFederation.
the class ConfigureCacheRefreshAction method updateAppliance.
private void updateAppliance() {
GluuAppliance updateAppliance = applianceService.getAppliance();
updateAppliance.setVdsCacheRefreshEnabled(this.appliance.getVdsCacheRefreshEnabled());
updateAppliance.setVdsCacheRefreshPollingInterval(this.appliance.getVdsCacheRefreshPollingInterval());
updateAppliance.setCacheRefreshServerIpAddress(this.appliance.getCacheRefreshServerIpAddress());
applianceService.updateAppliance(updateAppliance);
}
Aggregations