Class SsaJsonService

java.lang.Object
io.jans.as.server.ssa.ws.rs.SsaJsonService

@Named public class SsaJsonService extends Object
Provides json utilities for SSA
  • Constructor Details

    • SsaJsonService

      public SsaJsonService()
  • Method Details

    • jsonObjectToString

      public String jsonObjectToString(org.json.JSONObject jsonObject) throws org.json.JSONException
      Convert to json string from jsonObject.
      Parameters:
      jsonObject - Json object to convert
      Returns:
      Json string
      Throws:
      org.json.JSONException - If an error is found when converting.
    • jsonArrayToString

      public String jsonArrayToString(org.json.JSONArray jsonArray) throws org.json.JSONException
      Convert to json string from jsonArray.
      Parameters:
      jsonArray - Json array to convert
      Returns:
      Json string
      Throws:
      org.json.JSONException - If an error is found when converting.
    • getJSONArray

      public org.json.JSONArray getJSONArray(List<io.jans.as.common.model.ssa.Ssa> ssaList) throws org.json.JSONException
      Convert to JSONArray from ssaList with structure SSA.

      Method generates the SSA structure to add them to a json array.

      Parameters:
      ssaList - List of SSA
      Returns:
      Json array
      Throws:
      org.json.JSONException - If an error is found when converting.
    • getJSONObject

      public org.json.JSONObject getJSONObject(String jwt) throws org.json.JSONException
      Convert to JSON using jwt.
      Parameters:
      jwt - json web token of SSA
      Returns:
      Json object.
      Throws:
      org.json.JSONException - If an error is found when converting.