package com.sun.identity.saml2.plugins;

import com.sun.identity.saml2.common.SAML2Exception;
import com.sun.identity.saml2.protocol.AuthnRequest;
import com.sun.identity.saml2.protocol.LogoutRequest;
import com.sun.identity.saml2.protocol.LogoutResponse;
import com.sun.identity.saml2.protocol.Response;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.Map;

public abstract class SAML2ServiceProviderAdapter {
   public static final int SUCCESS = 0;
   public static final int INVALID_RESPONSE = 1;
   public static final int FEDERATION_FAILED_WRITING_ACCOUNT_INFO = 3;
   public static final int SSO_FAILED_SESSION_ERROR = 4;
   public static final int SSO_FAILED_ATTRIBUTE_MAPPING = 5;
   public static final int SSO_FAILED_NO_USER_MAPPING = 6;
   public static final int SSO_FAILED_AUTH_USER_INACTIVE = 7;
   public static final int SSO_FAILED_AUTH_USER_LOCKED = 8;
   public static final int SSO_FAILED_AUTH_ACCOUNT_EXPIRED = 9;
   public static final int SSO_FAILED_SESSION_GENERATION = 10;
   public static final int SSO_FAILED_META_DATA_ERROR = 11;
   public static final String HOSTED_ENTITY_ID = "HOSTED_ENTITY_ID";
   public static final String REALM = "REALM";

   public abstract void initialize(Map<String, String> var1);

   public void preSingleSignOnRequest(
      String hostedEntityID, String idpEntityID, String realm, HttpServletRequest request, HttpServletResponse response, AuthnRequest authnRequest
   ) throws SAML2Exception {
   }

   public void preSingleSignOnProcess(
      String hostedEntityID,
      String realm,
      HttpServletRequest request,
      HttpServletResponse response,
      AuthnRequest authnRequest,
      Response ssoResponse,
      String profile
   ) throws SAML2Exception {
   }

   public boolean postSingleSignOnSuccess(
      String hostedEntityID,
      String realm,
      HttpServletRequest request,
      HttpServletResponse response,
      Object session,
      AuthnRequest authnRequest,
      Response ssoResponse,
      String profile,
      boolean isFederation
   ) throws SAML2Exception {
      return false;
   }

   public boolean postSingleSignOnFailure(
      String hostedEntityID,
      String realm,
      HttpServletRequest request,
      HttpServletResponse response,
      AuthnRequest authnRequest,
      Response ssoResponse,
      String profile,
      int failureCode
   ) {
      return false;
   }

   public void preSingleLogoutProcess(
      String hostedEntityID,
      String realm,
      HttpServletRequest request,
      HttpServletResponse response,
      String userID,
      LogoutRequest logoutRequest,
      LogoutResponse logoutResponse,
      String binding
   ) throws SAML2Exception {
   }

   public void postSingleLogoutSuccess(
      String hostedEntityID,
      String realm,
      HttpServletRequest request,
      HttpServletResponse response,
      String userID,
      LogoutRequest logoutRequest,
      LogoutResponse logoutResponse,
      String binding
   ) {
   }
}
