mitreid-connect
静的公開変数類 | 限定公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.mitre.uma.view.ResourceSetEntityView クラス
org.mitre.uma.view.ResourceSetEntityView の継承関係図
Inheritance graph
org.mitre.uma.view.ResourceSetEntityView 連携図
Collaboration graph

静的公開変数類

static final String VIEWNAME = "resourceSetEntityView"
 

限定公開メンバ関数

void renderMergedOutputModel (Map< String, Object > model, HttpServletRequest request, HttpServletResponse response)
 

非公開変数類

ConfigurationPropertiesBean config
 
Gson gson
 

静的非公開変数類

static Logger logger = LoggerFactory.getLogger(JsonEntityView.class)
 

詳解

関数詳解

◆ renderMergedOutputModel()

void org.mitre.uma.view.ResourceSetEntityView.renderMergedOutputModel ( Map< String, Object >  model,
HttpServletRequest  request,
HttpServletResponse  response 
)
inlineprotected
80  {
81 
82  response.setContentType("application/json");
83 
84 
85  HttpStatus code = (HttpStatus) model.get("code");
86  if (code == null) {
87  code = HttpStatus.OK; // default to 200
88  }
89 
90  response.setStatus(code.value());
91 
92  String location = (String) model.get("location");
93  if (!Strings.isNullOrEmpty(location)) {
94  response.setHeader(HttpHeaders.LOCATION, location);
95  }
96 
97  try {
98 
99  Writer out = response.getWriter();
100  ResourceSet rs = (ResourceSet) model.get("entity");
101 
102  JsonObject o = new JsonObject();
103 
104  o.addProperty("_id", rs.getId().toString()); // send the id as a string
105  o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/resource/" + rs.getId());
106  o.addProperty("name", rs.getName());
107  o.addProperty("uri", rs.getUri());
108  o.addProperty("type", rs.getType());
109  o.add("scopes", JsonUtils.getAsArray(rs.getScopes()));
110  o.addProperty("icon_uri", rs.getIconUri());
111 
112  gson.toJson(o, out);
113 
114  } catch (IOException e) {
115 
116  logger.error("IOException in ResourceSetEntityView.java: ", e);
117 
118  }
119  }
ConfigurationPropertiesBean config
Definition: ResourceSetEntityView.java:53
Gson gson
Definition: ResourceSetEntityView.java:55
static Logger logger
Definition: ResourceSetEntityView.java:48
String getIssuer()
Definition: ConfigurationPropertiesBean.java:100

メンバ詳解

◆ config

ConfigurationPropertiesBean org.mitre.uma.view.ResourceSetEntityView.config
private

◆ gson

Gson org.mitre.uma.view.ResourceSetEntityView.gson
private
初期値:
= new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return false;
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
}
})
.serializeNulls()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.setLongSerializationPolicy(LongSerializationPolicy.STRING)
.create()

◆ logger

Logger org.mitre.uma.view.ResourceSetEntityView.logger = LoggerFactory.getLogger(JsonEntityView.class)
staticprivate

◆ VIEWNAME

final String org.mitre.uma.view.ResourceSetEntityView.VIEWNAME = "resourceSetEntityView"
static

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