1 23 24 28 29 package com.sun.enterprise.web.session; 30 31 35 public final class PersistenceType { 36 37 39 42 public static final PersistenceType MEMORY = 43 new PersistenceType("memory"); 44 45 48 public static final PersistenceType FILE = 49 new PersistenceType("file"); 50 51 54 public static final PersistenceType CUSTOM = 55 new PersistenceType("custom"); 56 57 60 public static final PersistenceType S1WS60 = 61 new PersistenceType("s1ws60"); 62 63 67 public static final PersistenceType MMAP = 68 new PersistenceType("mmap"); 69 70 73 public static final PersistenceType JDBC = 74 new PersistenceType("jdbc"); 75 76 79 public static final PersistenceType HA = 80 new PersistenceType("ha"); 81 82 85 public static final PersistenceType REPLICATED = 86 new PersistenceType("replicated"); 87 88 90 93 private PersistenceType(String type) { 94 _type = type; 95 } 96 97 99 102 private String _type = null; 103 104 106 110 public String getType() { 111 return _type; 112 } 113 114 116 121 public static PersistenceType parseType(String type) { 122 PersistenceType pType = MEMORY; 124 if (type != null) { 125 if (type.equalsIgnoreCase(FILE.getType())) 126 pType = FILE; 127 else if (type.equalsIgnoreCase(CUSTOM.getType())) 128 pType = CUSTOM; 129 else if (type.equalsIgnoreCase(S1WS60.getType())) 130 pType = S1WS60; 131 else if (type.equalsIgnoreCase(MMAP.getType())) 132 pType = MMAP; 133 else if (type.equalsIgnoreCase(JDBC.getType())) 134 pType = JDBC; 135 else if (type.equalsIgnoreCase(HA.getType())) 136 pType = HA; 137 else if (type.equalsIgnoreCase(REPLICATED.getType())) 138 pType = REPLICATED; 139 } 140 return pType; 141 } 142 143 148 public static PersistenceType parseType(String type, PersistenceType defaultType) { 149 PersistenceType pType = defaultType; 151 if (type != null) { 152 if (type.equalsIgnoreCase(MEMORY.getType())) 153 pType = MEMORY; 154 else if (type.equalsIgnoreCase(FILE.getType())) 155 pType = FILE; 156 else if (type.equalsIgnoreCase(CUSTOM.getType())) 157 pType = CUSTOM; 158 else if (type.equalsIgnoreCase(S1WS60.getType())) 159 pType = S1WS60; 160 else if (type.equalsIgnoreCase(MMAP.getType())) 161 pType = MMAP; 162 else if (type.equalsIgnoreCase(JDBC.getType())) 163 pType = JDBC; 164 else if (type.equalsIgnoreCase(HA.getType())) 165 pType = HA; 166 else if (type.equalsIgnoreCase(REPLICATED.getType())) 167 pType = REPLICATED; 168 } 169 return pType; 170 } 171 172 } 173 174 | Popular Tags |