gluu
公開メンバ関数 | 静的公開メンバ関数 | 静的変数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.credmanager.plugins.authnmethod.conf.SGConfig クラス
org.gluu.credmanager.plugins.authnmethod.conf.SGConfig の継承関係図
Inheritance graph
org.gluu.credmanager.plugins.authnmethod.conf.SGConfig 連携図
Collaboration graph

公開メンバ関数

String getAppId ()
 
void setAppId (String appId)
 
void populate (Map< String, String > properties) throws Exception
 
String getFormattedQROptions (int maxWidth)
 
String getFormattedQROptions ()
 
String getLabel ()
 
void setLabel (String label)
 
int getQrSize ()
 
void setQrSize (int qrSize)
 
double getQrMSize ()
 
void setQrMSize (double qrMSize)
 
String getRegistrationUri ()
 
void setRegistrationUri (String registrationUri)
 

静的公開メンバ関数

static SGConfig get (Map< String, String > propsMap)
 

静的変数

static ObjectMapper MAPPER = new ObjectMapper()
 

非公開変数類

String appId
 

静的非公開変数類

static Logger LOG = LogManager.getLogger(SGConfig.class)
 

詳解

Created by jgomer on 2017-09-06. POJO storing values needed for Supergluu. Static method of this class parse information belonging to the corresponding custom script to be able to get an instance of this class. Only the basic properties required for enrolling are parsed, so there is no need to inspect super_gluu_creds.json

関数詳解

◆ get()

static SGConfig org.gluu.credmanager.plugins.authnmethod.conf.SGConfig.get ( Map< String, String >  propsMap)
inlinestatic

Creates an SGConfig object to hold all properties required for SuperGluu operation

引数
propsMap
戻り値
null if an error or inconsistency is found while inspecting the configuration properties of the custom script. Otherwise returns a SGConfig object
35  {
36 
37  SGConfig cfg = new SGConfig();
38  try {
39  cfg.populate(propsMap);
40  LOG.info("Super Gluu settings found were: {}", MAPPER.writeValueAsString(cfg));
41  } catch (Exception e) {
42  LOG.error(e.getMessage(), e);
43  cfg = null;
44  }
45  return cfg;
46 
47  }
static ObjectMapper MAPPER
Definition: QRConfig.java:20
static Logger LOG
Definition: SGConfig.java:17

◆ getAppId()

String org.gluu.credmanager.plugins.authnmethod.conf.SGConfig.getAppId ( )
inline
21  {
22  return appId;
23  }
String appId
Definition: SGConfig.java:19

◆ getFormattedQROptions() [1/2]

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getFormattedQROptions ( int  maxWidth)
inlineinherited

Creates a string for a Json representation of two values: size and mSize for QR code

戻り値
Json String
55  {
56 
57  List<String> list = new ArrayList<>();
58  int size = getQrSize();
59  int ival = maxWidth > 0 ? Math.min(size, maxWidth - 30) : size;
60 
61  if (ival > 0) {
62  list.add("size:" + ival);
63  }
64 
65  double dval = getQrMSize();
66  if (dval > 0) {
67  list.add("mSize: " + dval);
68  }
69 
70  return list.toString().replaceFirst("\\[", "{").replaceFirst("\\]", "}");
71 
72  }
double getQrMSize()
Definition: QRConfig.java:94
int getQrSize()
Definition: QRConfig.java:86

◆ getFormattedQROptions() [2/2]

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getFormattedQROptions ( )
inlineinherited
74  {
75  return getFormattedQROptions(0);
76  }
String getFormattedQROptions()
Definition: QRConfig.java:74

◆ getLabel()

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getLabel ( )
inlineinherited
78  {
79  return label;
80  }
String label
Definition: QRConfig.java:22

◆ getQrMSize()

double org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getQrMSize ( )
inlineinherited
94  {
95  return qrMSize;
96  }
double qrMSize
Definition: QRConfig.java:26

◆ getQrSize()

int org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getQrSize ( )
inlineinherited
86  {
87  return qrSize;
88  }

◆ getRegistrationUri()

String org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.getRegistrationUri ( )
inlineinherited
102  {
103  return registrationUri;
104  }
String registrationUri
Definition: QRConfig.java:23

◆ populate()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.populate ( Map< String, String >  properties) throws Exception
inlineinherited
28  {
29 
30  setLabel(properties.get("label"));
31  setRegistrationUri(properties.get("registration_uri"));
32 
33  String value = properties.get("qr_options");
34  //value may come not properly formated (without quotes, for instance...)
35  if (!value.contains("\"")) {
36  value = value.replaceFirst("mSize", "\"mSize\"").replaceFirst("size", "\"size\"");
37  }
38 
39  JsonNode tree = MAPPER.readTree(value);
40 
41  if (tree.get("size") != null) {
42  setQrSize(tree.get("size").asInt());
43  }
44 
45  if (tree.get("mSize") != null) {
46  setQrMSize(tree.get("mSize").asDouble());
47  }
48 
49  }
void setRegistrationUri(String registrationUri)
Definition: QRConfig.java:106
static ObjectMapper MAPPER
Definition: QRConfig.java:20
void setLabel(String label)
Definition: QRConfig.java:82
void setQrSize(int qrSize)
Definition: QRConfig.java:90
void setQrMSize(double qrMSize)
Definition: QRConfig.java:98

◆ setAppId()

void org.gluu.credmanager.plugins.authnmethod.conf.SGConfig.setAppId ( String  appId)
inline
25  {
26  this.appId = appId;
27  }
String appId
Definition: SGConfig.java:19

◆ setLabel()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setLabel ( String  label)
inlineinherited
82  {
83  this.label = label;
84  }
String label
Definition: QRConfig.java:22

◆ setQrMSize()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setQrMSize ( double  qrMSize)
inlineinherited
98  {
99  this.qrMSize = qrMSize;
100  }
double qrMSize
Definition: QRConfig.java:26

◆ setQrSize()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setQrSize ( int  qrSize)
inlineinherited
90  {
91  this.qrSize = qrSize;
92  }

◆ setRegistrationUri()

void org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.setRegistrationUri ( String  registrationUri)
inlineinherited
106  {
108  }
String registrationUri
Definition: QRConfig.java:23

メンバ詳解

◆ appId

String org.gluu.credmanager.plugins.authnmethod.conf.SGConfig.appId
private

◆ LOG

Logger org.gluu.credmanager.plugins.authnmethod.conf.SGConfig.LOG = LogManager.getLogger(SGConfig.class)
staticprivate

◆ MAPPER

ObjectMapper org.gluu.credmanager.plugins.authnmethod.conf.QRConfig.MAPPER = new ObjectMapper()
staticpackageinherited

このクラス詳解は次のファイルから抽出されました: