-
Notifications
You must be signed in to change notification settings - Fork 613
/
Attribute.java
120 lines (108 loc) · 4.12 KB
/
Attribute.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* JBoss, Home of Professional Open Source
* Copyright 2011-2013 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
package org.infinispan.server.endpoint.subsystem;
import java.util.HashMap;
import java.util.Map;
import org.jboss.as.controller.AttributeDefinition;
/**
* Enumerates the attributes used in the Infinispan Endpoint subsystem schema.
*
* @author Tristan Tarrant
* @since 5.3
*/
public enum Attribute {
// must be first
UNKNOWN((String) null),
AWAIT_INITIAL_RETRIEVAL(ModelKeys.AWAIT_INITIAL_RETRIEVAL),
AUTH_METHOD(ModelKeys.AUTH_METHOD),
CONTEXT_PATH(ModelKeys.CONTEXT_PATH),
CACHE(ModelKeys.CACHE),
CACHE_CONTAINER(ModelKeys.CACHE_CONTAINER),
@Deprecated
CACHE_SUFFIX(ModelKeys.CACHE_SUFFIX),
IGNORED_CACHES(ModelKeys.IGNORED_CACHES),
EXTENDED_HEADERS(ModelKeys.EXTENDED_HEADERS),
EXTERNAL_HOST(ModelKeys.EXTERNAL_HOST),
EXTERNAL_PORT(ModelKeys.EXTERNAL_PORT),
IDLE_TIMEOUT(ModelKeys.IDLE_TIMEOUT),
MECHANISMS(ModelKeys.MECHANISMS),
HOST_NAME(ModelKeys.HOST_NAME),
PATH(ModelKeys.PATH),
LAZY_RETRIEVAL(ModelKeys.LAZY_RETRIEVAL),
LOCK_TIMEOUT(ModelKeys.LOCK_TIMEOUT),
REPLICATION_TIMEOUT(ModelKeys.REPLICATION_TIMEOUT),
MAX_CONTENT_LENGTH(ModelKeys.MAX_CONTENT_LENGTH),
NAME(ModelKeys.NAME),
QOP(ModelKeys.QOP),
RECEIVE_BUFFER_SIZE(ModelKeys.RECEIVE_BUFFER_SIZE),
REQUIRE_SSL_CLIENT_AUTH(ModelKeys.REQUIRE_SSL_CLIENT_AUTH),
SEND_BUFFER_SIZE(ModelKeys.SEND_BUFFER_SIZE),
SECURITY_DOMAIN(ModelKeys.SECURITY_DOMAIN),
SECURITY_MODE(ModelKeys.SECURITY_MODE),
SECURITY_REALM(ModelKeys.SECURITY_REALM),
SERVER_CONTEXT_NAME(ModelKeys.SERVER_CONTEXT_NAME),
SERVER_NAME(ModelKeys.SERVER_NAME),
SOCKET_BINDING(ModelKeys.SOCKET_BINDING),
REST_SOCKET_BINDING(ModelKeys.REST_SOCKET_BINDING),
HOTROD_SOCKET_BINDING(ModelKeys.HOTROD_SOCKET_BINDING),
SSL(ModelKeys.SSL),
STRENGTH(ModelKeys.STRENGTH),
TCP_NODELAY(ModelKeys.TCP_NODELAY),
KEEP_ALIVE(ModelKeys.KEEP_ALIVE),
UPDATE_TIMEOUT(ModelKeys.UPDATE_TIMEOUT),
VALUE(ModelKeys.VALUE),
VIRTUAL_HOST(ModelKeys.VIRTUAL_HOST),
VIRTUAL_SERVER(ModelKeys.VIRTUAL_SERVER),
WORKER_THREADS(ModelKeys.WORKER_THREADS),
;
private final String name;
private final AttributeDefinition definition;
private Attribute(final String name) {
this.name = name;
this.definition = null;
}
private Attribute(final AttributeDefinition definition) {
this.name = definition.getXmlName();
this.definition = definition;
}
/**
* Get the local name of this element.
*
* @return the local name
*/
public String getLocalName() {
return name;
}
public AttributeDefinition getDefinition() {
return definition;
}
private static final Map<String, Attribute> attributes;
static {
final Map<String, Attribute> map = new HashMap<String, Attribute>();
for (Attribute attribute : values()) {
final String name = attribute.getLocalName();
if (name != null) map.put(name, attribute);
}
attributes = map;
}
public static Attribute forName(String localName) {
final Attribute attribute = attributes.get(localName);
return attribute == null ? UNKNOWN : attribute;
}
}