Skip to content

Commit

Permalink
fix NoClassDefFoundError in openam-clientsdk, decouple from InternalS…
Browse files Browse the repository at this point in the history
…ession
  • Loading branch information
maximthomas committed Sep 20, 2023
1 parent ce258cc commit b3e3848
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public String toString() {
return String.format("%s sid=%s" , super.toString(),sessionID,this.getID());
}

/**
* Expiry time which is long enough to make sessions functionally non expiring.
*/
public static final long NON_EXPIRING_SESSION_LENGTH_MINUTES = 42 * TimeUnit.DAYS.toMinutes(365);

/*
* Session property names
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import com.iplanet.am.util.SystemProperties;
import com.sun.identity.shared.Constants;

import java.util.concurrent.TimeUnit;

public class SessionConstants {

public static final String SESSION_DEBUG = "amSession";
Expand Down Expand Up @@ -109,4 +111,9 @@ public class SessionConstants {
public static final int DEFAULT_POOL_SIZE = 5;

public static final int DEFAULT_THRESHOLD = 10000;

/**
* Expiry time which is long enough to make sessions functionally non expiring.
*/
public static final long NON_EXPIRING_SESSION_LENGTH_MINUTES = 42 * TimeUnit.DAYS.toMinutes(365);
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void rescheduleIfWillTimeOutBeforeExecution(long timeoutTime) {
* Returns true if the provided time is less than Long.MAX_VALUE seconds.
*/
boolean willExpire(long minutes) {
return minutes < InternalSession.NON_EXPIRING_SESSION_LENGTH_MINUTES;
return minutes < SessionConstants.NON_EXPIRING_SESSION_LENGTH_MINUTES;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.forgerock.openam.session.service;

import static com.iplanet.dpro.session.service.InternalSession.NON_EXPIRING_SESSION_LENGTH_MINUTES;
import static org.forgerock.openam.session.SessionConstants.NON_EXPIRING_SESSION_LENGTH_MINUTES;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.forgerock.openam.session.SessionConstants;
import org.forgerock.openam.session.service.NonExpiringSessionManager;
import org.forgerock.openam.shared.concurrency.ThreadMonitor;
import org.mockito.Mock;
Expand Down Expand Up @@ -75,7 +76,7 @@ public void shouldBeThreadMonitoredAndScheduled() {
@Test
public void shouldSetUpSessionCorrectly() {
nonExpiringSessionManager.addNonExpiringSession(mockInternalSession);
verify(mockInternalSession).setMaxSessionTime(InternalSession.NON_EXPIRING_SESSION_LENGTH_MINUTES);
verify(mockInternalSession).setMaxSessionTime(SessionConstants.NON_EXPIRING_SESSION_LENGTH_MINUTES);
verify(mockInternalSession).setMaxIdleTime(5*10);
verify(mockInternalSession).setLatestAccessTime();
}
Expand Down

0 comments on commit b3e3848

Please sign in to comment.