1   package org.kuali.rice.ksb.api.registry;
2   
3   import org.kuali.rice.core.api.mo.common.Coded;
4   import org.kuali.rice.core.api.util.jaxb.EnumStringAdapter;
5   
6   import javax.xml.bind.annotation.XmlEnum;
7   import javax.xml.bind.annotation.XmlEnumValue;
8   import javax.xml.bind.annotation.XmlRootElement;
9   import javax.xml.bind.annotation.XmlType;
10  
11  
12  
13  
14  
15  
16  @XmlRootElement(name = "serviceEndpointStatus")
17  @XmlType(name = "ServiceEndpointStatusType")
18  @XmlEnum
19  public enum ServiceEndpointStatus implements Coded {
20  
21  	
22  
23  
24  	@XmlEnumValue("A") ONLINE("A"),
25  	
26  	
27  
28  
29  
30  
31  	@XmlEnumValue("I") OFFLINE("I"),
32  	
33  	
34  
35  
36  
37  
38  	@XmlEnumValue("D") DISABLED("D");
39  	
40  	private final String code;
41  	
42  	ServiceEndpointStatus(final String code) {
43  		this.code = code;
44  	}
45  	
46  	@Override
47  	public String getCode() {
48  		return this.code;
49  	}
50  	
51  	
52  
53  
54  
55  
56  
57  
58  
59  
60  	public static ServiceEndpointStatus fromCode(String code) {
61  		if (code == null) {
62  			return null;
63  		}
64  		for (ServiceEndpointStatus status : values()) {
65  			if (status.code.equals(code)) {
66  				return status;
67  			}
68  		}
69  		throw new IllegalArgumentException("Failed to locate the ServiceEndpointStatus with the given code: " + code);
70  	}
71  	
72  	
73  
74  
75  	static final class Adapter extends EnumStringAdapter<ServiceEndpointStatus> {
76  		
77  		protected Class<ServiceEndpointStatus> getEnumClass() {
78  			return ServiceEndpointStatus.class;
79  		}
80  		
81  	}
82  	
83  }