Search in sources :

Example 6 with GluuAppliance

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);
}
Also used : GluuAppliance(org.gluu.oxtrust.model.GluuAppliance)

Example 7 with GluuAppliance

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);
}
Also used : GluuAppliance(org.gluu.oxtrust.model.GluuAppliance)

Example 8 with GluuAppliance

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");
}
Also used : GluuAppliance(org.gluu.oxtrust.model.GluuAppliance) Date(java.util.Date) Test(org.testng.annotations.Test) BaseTest(org.gluu.oxtrust.action.test.BaseTest)

Example 9 with GluuAppliance

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");
}
Also used : GluuAppliance(org.gluu.oxtrust.model.GluuAppliance) Date(java.util.Date) Test(org.testng.annotations.Test) BaseTest(org.gluu.oxtrust.action.test.BaseTest)

Example 10 with GluuAppliance

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);
}
Also used : GluuAppliance(org.gluu.oxtrust.model.GluuAppliance)

Aggregations

GluuAppliance (org.gluu.oxtrust.model.GluuAppliance)36 Date (java.util.Date)8 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)7 IOException (java.io.IOException)5 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)5 GluuCustomAttribute (org.gluu.oxtrust.model.GluuCustomAttribute)4 File (java.io.File)3 SimpleDateFormat (java.text.SimpleDateFormat)3 ArrayList (java.util.ArrayList)3 BaseTest (org.gluu.oxtrust.action.test.BaseTest)3 PasswordResetRequest (org.gluu.oxtrust.model.PasswordResetRequest)3 TrustStoreCertificate (org.gluu.oxtrust.model.cert.TrustStoreCertificate)3 Test (org.testng.annotations.Test)3 ParseException (java.text.ParseException)2 Calendar (java.util.Calendar)2 AuthenticationFailedException (javax.mail.AuthenticationFailedException)2 MessagingException (javax.mail.MessagingException)2 OxIDPAuthConf (org.gluu.oxtrust.model.OxIDPAuthConf)2 TrustStoreConfiguration (org.gluu.oxtrust.model.cert.TrustStoreConfiguration)2 MailUtils (org.gluu.oxtrust.util.MailUtils)2