MCPcopy Index your code
hub / github.com/apache/tomcat / getAttribute

Method getAttribute

java/org/apache/catalina/connector/Request.java:933–995  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

931 // ------------------------------------------------- ServletRequest Methods
932
933 @SuppressWarnings("deprecation")
934 @Override
935 public Object getAttribute(String name) {
936 if (name == null) {
937 throw new IllegalArgumentException(sm.getString("request.nullAttributeName"));
938 }
939
940 // Special attributes
941 SpecialAttributeAdapter adapter = specialAttributes.get(name);
942 if (adapter != null) {
943 return adapter.get(this, name);
944 }
945
946 Object attr = attributes.get(name);
947
948 if (attr != null) {
949 return attr;
950 }
951
952 attr = coyoteRequest.getAttribute(name);
953 if (attr != null) {
954 return attr;
955 }
956 if (!sslAttributesParsed && TLSUtil.isTLSRequestAttribute(name)) {
957 coyoteRequest.action(ActionCode.REQ_SSL_ATTRIBUTE, coyoteRequest);
958 attr = coyoteRequest.getAttribute(Globals.CERTIFICATES_ATTR);
959 if (attr != null) {
960 attributes.put(Globals.CERTIFICATES_ATTR, attr);
961 }
962 attr = coyoteRequest.getAttribute(Globals.SECURE_PROTOCOL_ATTR);
963 if (attr != null) {
964 attributes.put(Globals.SECURE_PROTOCOL_ATTR, attr);
965 attributes.put(SSLSupport.PROTOCOL_VERSION_KEY, attr);
966 }
967 attr = coyoteRequest.getAttribute(Globals.CIPHER_SUITE_ATTR);
968 if (attr != null) {
969 attributes.put(Globals.CIPHER_SUITE_ATTR, attr);
970 }
971 attr = coyoteRequest.getAttribute(Globals.KEY_SIZE_ATTR);
972 if (attr != null) {
973 attributes.put(Globals.KEY_SIZE_ATTR, attr);
974 }
975 attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_ID_ATTR);
976 if (attr != null) {
977 attributes.put(Globals.SSL_SESSION_ID_ATTR, attr);
978 }
979 attr = coyoteRequest.getAttribute(Globals.SSL_SESSION_MGR_ATTR);
980 if (attr != null) {
981 attributes.put(Globals.SSL_SESSION_MGR_ATTR, attr);
982 }
983 attr = coyoteRequest.getAttribute(SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY);
984 if (attr != null) {
985 attributes.put(SSLSupport.REQUESTED_PROTOCOL_VERSIONS_KEY, attr);
986 }
987 attr = coyoteRequest.getAttribute(SSLSupport.REQUESTED_CIPHERS_KEY);
988 if (attr != null) {
989 attributes.put(SSLSupport.REQUESTED_CIPHERS_KEY, attr);
990 }

Callers 5

dispatchMethod · 0.95
getAttributeNamesMethod · 0.95
getRequestDispatcherMethod · 0.95
asyncDispatchMethod · 0.95
serviceMethod · 0.95

Calls 6

getMethod · 0.95
isTLSRequestAttributeMethod · 0.95
getStringMethod · 0.65
getAttributeMethod · 0.65
actionMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected