Class SsaJsonService


  • @Named
    public class SsaJsonService
    extends java.lang.Object
    Provides json utilities for SSA
    • Constructor Summary

      Constructors 
      Constructor Description
      SsaJsonService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.json.JSONArray getJSONArray​(java.util.List<io.jans.as.common.model.ssa.Ssa> ssaList)
      Convert to JSONArray from ssaList with structure SSA.
      org.json.JSONObject getJSONObject​(java.lang.String jwt)
      Convert to JSON using jwt.
      java.lang.String jsonArrayToString​(org.json.JSONArray jsonArray)
      Convert to json string from jsonArray.
      java.lang.String jsonObjectToString​(org.json.JSONObject jsonObject)
      Convert to json string from jsonObject.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SsaJsonService

        public SsaJsonService()
    • Method Detail

      • jsonObjectToString

        public java.lang.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 java.lang.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​(java.util.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​(java.lang.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.