mitreid-connect
公開メンバ関数 | 静的公開変数類 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.mitre.openid.connect.web.DataAPI クラス
org.mitre.openid.connect.web.DataAPI 連携図
Collaboration graph

公開メンバ関数

String importData (Reader in, Model m) throws IOException
 
void exportData (HttpServletResponse resp, Principal prin) throws IOException
 

静的公開変数類

static final String URL = RootController.API_URL + "/data"
 

非公開変数類

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
 
ConfigurationPropertiesBean config
 
List< MITREidDataServiceimporters
 
List< String > supportedVersions
 
MITREidDataService_1_3 exporter
 

静的非公開変数類

static final Logger logger = LoggerFactory.getLogger(DataAPI.class)
 

詳解

API endpoint for importing and exporting the current state of a server. Includes all tokens, grants, whitelists, blacklists, and clients.

著者
jricher

関数詳解

◆ exportData()

void org.mitre.openid.connect.web.DataAPI.exportData ( HttpServletResponse  resp,
Principal  prin 
) throws IOException
inline
124  {
125 
126  resp.setContentType(MediaType.APPLICATION_JSON_VALUE);
127 
128  // this writer puts things out onto the wire
129  JsonWriter writer = new JsonWriter(resp.getWriter());
130  writer.setIndent(" ");
131 
132  try {
133 
134  writer.beginObject();
135 
136  writer.name("exported-at");
137  writer.value(dateFormat.format(new Date()));
138 
139  writer.name("exported-from");
140  writer.value(config.getIssuer());
141 
142  writer.name("exported-by");
143  writer.value(prin.getName());
144 
145  // delegate to the service to do the actual export
146  exporter.exportData(writer);
147 
148  writer.endObject(); // end root
149  writer.close();
150 
151  } catch (IOException e) {
152  logger.error("Unable to export data", e);
153  }
154  }
void exportData(JsonWriter writer)
Definition: MITREidDataService_1_3.java:188
ConfigurationPropertiesBean config
Definition: DataAPI.java:69
static final Logger logger
Definition: DataAPI.java:64
SimpleDateFormat dateFormat
Definition: DataAPI.java:66
MITREidDataService_1_3 exporter
Definition: DataAPI.java:81
String getIssuer()
Definition: ConfigurationPropertiesBean.java:100

◆ importData()

String org.mitre.openid.connect.web.DataAPI.importData ( Reader  in,
Model  m 
) throws IOException
inline
84  {
85 
86  JsonReader reader = new JsonReader(in);
87 
88  reader.beginObject();
89 
90  while (reader.hasNext()) {
91  JsonToken tok = reader.peek();
92  switch (tok) {
93  case NAME:
94  String name = reader.nextName();
95 
96  if (supportedVersions.contains(name)) {
97  // we're working with a known data version tag
98  for (MITREidDataService dataService : importers) {
99  // dispatch to the correct service
100  if (dataService.supportsVersion(name)) {
101  dataService.importData(reader);
102  break;
103  }
104  }
105  } else {
106  // consume the next bit silently for now
107  logger.debug("Skipping value for " + name); // TODO: write these out?
108  reader.skipValue();
109  }
110  break;
111  case END_OBJECT:
112  break;
113  case END_DOCUMENT:
114  break;
115  }
116  }
117 
118  reader.endObject();
119 
120  return "httpCodeView";
121  }
List< String > supportedVersions
Definition: DataAPI.java:74
List< MITREidDataService > importers
Definition: DataAPI.java:72
static final Logger logger
Definition: DataAPI.java:64

メンバ詳解

◆ config

ConfigurationPropertiesBean org.mitre.openid.connect.web.DataAPI.config
private

◆ dateFormat

SimpleDateFormat org.mitre.openid.connect.web.DataAPI.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
private

◆ exporter

MITREidDataService_1_3 org.mitre.openid.connect.web.DataAPI.exporter
private

◆ importers

List<MITREidDataService> org.mitre.openid.connect.web.DataAPI.importers
private

◆ logger

final Logger org.mitre.openid.connect.web.DataAPI.logger = LoggerFactory.getLogger(DataAPI.class)
staticprivate

Logger for this class

◆ supportedVersions

List<String> org.mitre.openid.connect.web.DataAPI.supportedVersions
private
初期値:
= ImmutableList.of(
MITREidDataService.MITREID_CONNECT_1_0,
MITREidDataService.MITREID_CONNECT_1_1,
MITREidDataService.MITREID_CONNECT_1_2,
MITREidDataService.MITREID_CONNECT_1_3)

◆ URL

final String org.mitre.openid.connect.web.DataAPI.URL = RootController.API_URL + "/data"
static

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