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

静的公開変数類

static final String VIEWNAME = "resourceSetEntityAbbreviatedView"
 
static final String LOCATION = "location"
 

限定公開メンバ関数

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.ResourceSetEntityAbbreviatedView.renderMergedOutputModel ( Map< String, Object >  model,
HttpServletRequest  request,
HttpServletResponse  response 
)
inlineprotected
82  {
83 
84  response.setContentType("application/json");
85 
86 
87  HttpStatus code = (HttpStatus) model.get(HttpCodeView.CODE);
88  if (code == null) {
89  code = HttpStatus.OK; // default to 200
90  }
91 
92  response.setStatus(code.value());
93 
94  String location = (String) model.get(LOCATION);
95  if (!Strings.isNullOrEmpty(location)) {
96  response.setHeader(HttpHeaders.LOCATION, location);
97  }
98 
99  try {
100 
101  Writer out = response.getWriter();
102  ResourceSet rs = (ResourceSet) model.get(JsonEntityView.ENTITY);
103 
104  JsonObject o = new JsonObject();
105 
106  o.addProperty("_id", rs.getId().toString()); // set the ID to a string
107  o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/user/policy/" + rs.getId());
108 
109 
110  gson.toJson(o, out);
111 
112  } catch (IOException e) {
113 
114  logger.error("IOException in ResourceSetEntityView.java: ", e);
115 
116  }
117  }
static final String LOCATION
Definition: ResourceSetEntityAbbreviatedView.java:52
static Logger logger
Definition: ResourceSetEntityAbbreviatedView.java:48
ConfigurationPropertiesBean config
Definition: ResourceSetEntityAbbreviatedView.java:55
Gson gson
Definition: ResourceSetEntityAbbreviatedView.java:57
String getIssuer()
Definition: ConfigurationPropertiesBean.java:100

メンバ詳解

◆ config

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

◆ gson

Gson org.mitre.uma.view.ResourceSetEntityAbbreviatedView.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()

◆ LOCATION

final String org.mitre.uma.view.ResourceSetEntityAbbreviatedView.LOCATION = "location"
static

◆ logger

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

◆ VIEWNAME

final String org.mitre.uma.view.ResourceSetEntityAbbreviatedView.VIEWNAME = "resourceSetEntityAbbreviatedView"
static

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