| 1 | |
package org.apache.turbine.services.security.torque; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
import java.beans.PropertyDescriptor; |
| 23 | |
|
| 24 | |
import java.util.ArrayList; |
| 25 | |
import java.util.Iterator; |
| 26 | |
import java.util.List; |
| 27 | |
|
| 28 | |
import org.apache.commons.configuration.Configuration; |
| 29 | |
|
| 30 | |
import org.apache.commons.logging.Log; |
| 31 | |
import org.apache.commons.logging.LogFactory; |
| 32 | |
|
| 33 | |
import org.apache.turbine.om.security.Group; |
| 34 | |
import org.apache.turbine.om.security.Role; |
| 35 | |
import org.apache.turbine.om.security.User; |
| 36 | |
import org.apache.turbine.services.InitializationException; |
| 37 | |
import org.apache.turbine.services.security.TurbineSecurity; |
| 38 | |
import org.apache.turbine.services.security.torque.om.TurbineUserGroupRolePeer; |
| 39 | |
import org.apache.turbine.util.security.DataBackendException; |
| 40 | |
import org.apache.turbine.util.security.RoleSet; |
| 41 | |
|
| 42 | |
import org.apache.torque.TorqueException; |
| 43 | |
import org.apache.torque.om.Persistent; |
| 44 | |
import org.apache.torque.util.BasePeer; |
| 45 | |
import org.apache.torque.util.Criteria; |
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | 0 | public class RolePeerManager |
| 57 | |
implements RolePeerManagerConstants |
| 58 | |
{ |
| 59 | |
|
| 60 | 0 | private static Class rolePeerClass = null; |
| 61 | |
|
| 62 | |
|
| 63 | 0 | private static Class roleObject = null; |
| 64 | |
|
| 65 | |
|
| 66 | 0 | private static String tableName = null; |
| 67 | |
|
| 68 | |
|
| 69 | 0 | private static String nameColumn = null; |
| 70 | |
|
| 71 | |
|
| 72 | 0 | private static String idColumn = null; |
| 73 | |
|
| 74 | |
|
| 75 | 0 | private static PropertyDescriptor namePropDesc = null; |
| 76 | |
|
| 77 | |
|
| 78 | 0 | private static PropertyDescriptor idPropDesc = null; |
| 79 | |
|
| 80 | |
|
| 81 | 0 | static Log log = LogFactory.getLog(RolePeerManager.class); |
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
public static void init(Configuration conf) |
| 94 | |
throws InitializationException |
| 95 | |
{ |
| 96 | 0 | String rolePeerClassName = conf.getString(ROLE_PEER_CLASS_KEY, |
| 97 | |
ROLE_PEER_CLASS_DEFAULT); |
| 98 | |
|
| 99 | 0 | String roleObjectName = null; |
| 100 | |
|
| 101 | |
try |
| 102 | |
{ |
| 103 | 0 | rolePeerClass = Class.forName(rolePeerClassName); |
| 104 | |
|
| 105 | 0 | tableName = |
| 106 | |
(String) rolePeerClass.getField("TABLE_NAME").get(null); |
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
|
| 112 | |
|
| 113 | |
|
| 114 | |
|
| 115 | 0 | roleObject = getPersistenceClass(); |
| 116 | |
|
| 117 | 0 | roleObjectName = conf.getString(ROLE_CLASS_KEY, |
| 118 | |
roleObject.getName()); |
| 119 | |
|
| 120 | |
|
| 121 | 0 | roleObject = Class.forName(roleObjectName); |
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
|
| 126 | |
|
| 127 | |
|
| 128 | 0 | nameColumn = (String) rolePeerClass.getField( |
| 129 | |
conf.getString(ROLE_NAME_COLUMN_KEY, |
| 130 | |
ROLE_NAME_COLUMN_DEFAULT) |
| 131 | |
).get(null); |
| 132 | |
|
| 133 | 0 | idColumn = (String) rolePeerClass.getField( |
| 134 | |
conf.getString(ROLE_ID_COLUMN_KEY, |
| 135 | |
ROLE_ID_COLUMN_DEFAULT) |
| 136 | |
).get(null); |
| 137 | |
|
| 138 | 0 | namePropDesc = new PropertyDescriptor( |
| 139 | |
conf.getString(ROLE_NAME_PROPERTY_KEY, |
| 140 | |
ROLE_NAME_PROPERTY_DEFAULT), |
| 141 | |
roleObject); |
| 142 | |
|
| 143 | 0 | idPropDesc = new PropertyDescriptor( |
| 144 | |
conf.getString(ROLE_ID_PROPERTY_KEY, |
| 145 | |
ROLE_ID_PROPERTY_DEFAULT), |
| 146 | |
roleObject); |
| 147 | |
|
| 148 | |
} |
| 149 | 0 | catch (Exception e) |
| 150 | |
{ |
| 151 | 0 | if (rolePeerClassName == null || rolePeerClass == null) |
| 152 | |
{ |
| 153 | 0 | throw new InitializationException( |
| 154 | |
"Could not find RolePeer class (" |
| 155 | |
+ rolePeerClassName + ")", e); |
| 156 | |
} |
| 157 | 0 | if (tableName == null) |
| 158 | |
{ |
| 159 | 0 | throw new InitializationException( |
| 160 | |
"Failed to get the table name from the Peer object", e); |
| 161 | |
} |
| 162 | |
|
| 163 | 0 | if (roleObject == null || roleObjectName == null) |
| 164 | |
{ |
| 165 | 0 | throw new InitializationException( |
| 166 | |
"Failed to get the object type from the Peer object", e); |
| 167 | |
} |
| 168 | |
|
| 169 | |
|
| 170 | 0 | if (nameColumn == null || namePropDesc == null) |
| 171 | |
{ |
| 172 | 0 | throw new InitializationException( |
| 173 | |
"RolePeer " + rolePeerClassName |
| 174 | |
+ " has no name column information!", e); |
| 175 | |
} |
| 176 | 0 | if (idColumn == null || idPropDesc == null) |
| 177 | |
{ |
| 178 | 0 | throw new InitializationException( |
| 179 | |
"RolePeer " + rolePeerClassName |
| 180 | |
+ " has no id column information!", e); |
| 181 | |
} |
| 182 | 0 | } |
| 183 | 0 | } |
| 184 | |
|
| 185 | |
|
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
|
| 190 | |
public static String getTableName() |
| 191 | |
{ |
| 192 | 0 | return tableName; |
| 193 | |
} |
| 194 | |
|
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
public static String getNameColumn() |
| 202 | |
{ |
| 203 | 0 | return nameColumn; |
| 204 | |
} |
| 205 | |
|
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | |
|
| 210 | |
|
| 211 | |
|
| 212 | |
public static String getIdColumn() |
| 213 | |
{ |
| 214 | 0 | return idColumn; |
| 215 | |
} |
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
|
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
public static String getColumnName(String name) |
| 225 | |
{ |
| 226 | 0 | StringBuffer sb = new StringBuffer(); |
| 227 | 0 | sb.append(getTableName()); |
| 228 | 0 | sb.append("."); |
| 229 | 0 | sb.append(name); |
| 230 | 0 | return sb.toString(); |
| 231 | |
} |
| 232 | |
|
| 233 | |
|
| 234 | |
|
| 235 | |
|
| 236 | |
|
| 237 | |
|
| 238 | |
|
| 239 | |
|
| 240 | |
|
| 241 | |
|
| 242 | |
public static Persistent newPersistentInstance() |
| 243 | |
{ |
| 244 | 0 | Persistent obj = null; |
| 245 | |
|
| 246 | 0 | if (roleObject == null) |
| 247 | |
{ |
| 248 | |
|
| 249 | |
|
| 250 | |
|
| 251 | |
|
| 252 | |
|
| 253 | |
|
| 254 | 0 | return obj; |
| 255 | |
} |
| 256 | |
|
| 257 | |
try |
| 258 | |
{ |
| 259 | 0 | obj = (Persistent) roleObject.newInstance(); |
| 260 | |
} |
| 261 | 0 | catch (Exception e) |
| 262 | |
{ |
| 263 | 0 | log.error("Could not instantiate a role object", e); |
| 264 | 0 | obj = null; |
| 265 | 0 | } |
| 266 | 0 | return obj; |
| 267 | |
} |
| 268 | |
|
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
|
| 274 | |
|
| 275 | |
|
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
public static RoleSet retrieveSet(Criteria criteria) |
| 281 | |
throws Exception |
| 282 | |
{ |
| 283 | 0 | List results = doSelect(criteria); |
| 284 | 0 | RoleSet rs = new RoleSet(); |
| 285 | |
|
| 286 | 0 | for (Iterator it = results.iterator(); it.hasNext(); ) |
| 287 | |
{ |
| 288 | 0 | rs.add((Role) it.next()); |
| 289 | |
} |
| 290 | 0 | return rs; |
| 291 | |
} |
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
|
| 298 | |
|
| 299 | |
|
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
public static RoleSet retrieveSet(User user, Group group) |
| 304 | |
throws Exception |
| 305 | |
{ |
| 306 | 0 | Criteria criteria = new Criteria(); |
| 307 | |
|
| 308 | 0 | criteria.add(UserPeerManager.getNameColumn(), |
| 309 | |
user.getName()); |
| 310 | |
|
| 311 | 0 | criteria.add(TurbineUserGroupRolePeer.GROUP_ID, |
| 312 | |
((Persistent) group).getPrimaryKey()); |
| 313 | |
|
| 314 | 0 | criteria.addJoin(UserPeerManager.getIdColumn(), |
| 315 | |
TurbineUserGroupRolePeer.USER_ID); |
| 316 | |
|
| 317 | 0 | criteria.addJoin(TurbineUserGroupRolePeer.ROLE_ID, getIdColumn()); |
| 318 | |
|
| 319 | 0 | return retrieveSet(criteria); |
| 320 | |
} |
| 321 | |
|
| 322 | |
|
| 323 | |
|
| 324 | |
|
| 325 | |
|
| 326 | |
|
| 327 | |
|
| 328 | |
|
| 329 | |
|
| 330 | |
|
| 331 | |
|
| 332 | |
public static boolean checkExists(Role role) |
| 333 | |
throws DataBackendException, Exception |
| 334 | |
{ |
| 335 | 0 | Criteria criteria = new Criteria(); |
| 336 | |
|
| 337 | 0 | criteria.addSelectColumn(getIdColumn()); |
| 338 | |
|
| 339 | 0 | criteria.add(getNameColumn(), role.getName()); |
| 340 | |
|
| 341 | 0 | List results = BasePeer.doSelect(criteria); |
| 342 | |
|
| 343 | 0 | if (results.size() > 1) |
| 344 | |
{ |
| 345 | 0 | throw new DataBackendException("Multiple roles named '" + |
| 346 | |
role.getName() + "' exist!"); |
| 347 | |
} |
| 348 | 0 | return (results.size() == 1); |
| 349 | |
} |
| 350 | |
|
| 351 | |
|
| 352 | |
|
| 353 | |
|
| 354 | |
|
| 355 | |
|
| 356 | |
|
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
|
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
|
| 370 | |
|
| 371 | |
|
| 372 | |
|
| 373 | |
public static Criteria buildCriteria(Role role) |
| 374 | |
{ |
| 375 | |
Criteria crit; |
| 376 | |
|
| 377 | |
try |
| 378 | |
{ |
| 379 | 0 | Class[] clazz = new Class[] { roleObject }; |
| 380 | 0 | Object[] params = |
| 381 | |
new Object[] { ((TorqueRole) role).getPersistentObj() }; |
| 382 | |
|
| 383 | 0 | crit = (Criteria) rolePeerClass |
| 384 | |
.getMethod("buildCriteria", clazz) |
| 385 | |
.invoke(null, params); |
| 386 | |
} |
| 387 | 0 | catch (Exception e) |
| 388 | |
{ |
| 389 | 0 | crit = null; |
| 390 | 0 | } |
| 391 | |
|
| 392 | 0 | return crit; |
| 393 | |
} |
| 394 | |
|
| 395 | |
|
| 396 | |
|
| 397 | |
|
| 398 | |
|
| 399 | |
|
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
public static void doUpdate(Criteria criteria) |
| 404 | |
throws TorqueException |
| 405 | |
{ |
| 406 | |
try |
| 407 | |
{ |
| 408 | 0 | Class[] clazz = new Class[] { Criteria.class }; |
| 409 | 0 | Object[] params = new Object[] { criteria }; |
| 410 | |
|
| 411 | 0 | rolePeerClass |
| 412 | |
.getMethod("doUpdate", clazz) |
| 413 | |
.invoke(null, params); |
| 414 | |
} |
| 415 | 0 | catch (Exception e) |
| 416 | |
{ |
| 417 | 0 | throw new TorqueException("doUpdate failed", e); |
| 418 | 0 | } |
| 419 | 0 | } |
| 420 | |
|
| 421 | |
|
| 422 | |
|
| 423 | |
|
| 424 | |
|
| 425 | |
|
| 426 | |
|
| 427 | |
|
| 428 | |
|
| 429 | |
public static void doInsert(Criteria criteria) |
| 430 | |
throws TorqueException |
| 431 | |
{ |
| 432 | |
try |
| 433 | |
{ |
| 434 | 0 | Class[] clazz = new Class[] { Criteria.class }; |
| 435 | 0 | Object[] params = new Object[] { criteria }; |
| 436 | |
|
| 437 | 0 | rolePeerClass |
| 438 | |
.getMethod("doInsert", clazz) |
| 439 | |
.invoke(null, params); |
| 440 | |
} |
| 441 | 0 | catch (Exception e) |
| 442 | |
{ |
| 443 | 0 | throw new TorqueException("doInsert failed", e); |
| 444 | 0 | } |
| 445 | 0 | } |
| 446 | |
|
| 447 | |
|
| 448 | |
|
| 449 | |
|
| 450 | |
|
| 451 | |
|
| 452 | |
|
| 453 | |
|
| 454 | |
|
| 455 | |
|
| 456 | |
public static List doSelect(Criteria criteria) |
| 457 | |
throws TorqueException |
| 458 | |
{ |
| 459 | |
List list; |
| 460 | |
|
| 461 | |
try |
| 462 | |
{ |
| 463 | 0 | Class[] clazz = |
| 464 | |
new Class[] { Criteria.class }; |
| 465 | 0 | Object[] params = new Object[] { criteria }; |
| 466 | |
|
| 467 | 0 | list = (List) rolePeerClass |
| 468 | |
.getMethod("doSelect", clazz) |
| 469 | |
.invoke(null, params); |
| 470 | |
} |
| 471 | 0 | catch (Exception e) |
| 472 | |
{ |
| 473 | 0 | throw new TorqueException("doSelect failed", e); |
| 474 | 0 | } |
| 475 | 0 | List newList = new ArrayList(list.size()); |
| 476 | |
|
| 477 | |
|
| 478 | |
|
| 479 | |
|
| 480 | 0 | for (Iterator it = list.iterator(); it.hasNext(); ) |
| 481 | |
{ |
| 482 | 0 | Role r = getNewRole((Persistent) it.next()); |
| 483 | 0 | newList.add(r); |
| 484 | 0 | } |
| 485 | |
|
| 486 | 0 | return newList; |
| 487 | |
} |
| 488 | |
|
| 489 | |
|
| 490 | |
|
| 491 | |
|
| 492 | |
|
| 493 | |
|
| 494 | |
|
| 495 | |
|
| 496 | |
public static void doDelete(Criteria criteria) |
| 497 | |
throws TorqueException |
| 498 | |
{ |
| 499 | |
try |
| 500 | |
{ |
| 501 | 0 | Class[] clazz = new Class[] { Criteria.class }; |
| 502 | 0 | Object[] params = new Object[] { criteria }; |
| 503 | |
|
| 504 | 0 | rolePeerClass |
| 505 | |
.getMethod("doDelete", clazz) |
| 506 | |
.invoke(null, params); |
| 507 | |
} |
| 508 | 0 | catch (Exception e) |
| 509 | |
{ |
| 510 | 0 | throw new TorqueException("doDelete failed", e); |
| 511 | 0 | } |
| 512 | 0 | } |
| 513 | |
|
| 514 | |
|
| 515 | |
|
| 516 | |
|
| 517 | |
|
| 518 | |
|
| 519 | |
|
| 520 | |
|
| 521 | |
public static void setRoleName(Persistent obj, String name) |
| 522 | |
{ |
| 523 | 0 | if (obj == null) |
| 524 | |
{ |
| 525 | 0 | return; |
| 526 | |
} |
| 527 | |
|
| 528 | |
try |
| 529 | |
{ |
| 530 | 0 | Object[] params = new Object[] { name }; |
| 531 | 0 | namePropDesc.getWriteMethod().invoke(obj, params); |
| 532 | |
} |
| 533 | 0 | catch (ClassCastException cce) |
| 534 | |
{ |
| 535 | 0 | String msg = obj.getClass().getName() + " does not seem to be a Role Object!"; |
| 536 | 0 | log.error(msg); |
| 537 | 0 | throw new RuntimeException(msg); |
| 538 | |
} |
| 539 | 0 | catch (Exception e) |
| 540 | |
{ |
| 541 | 0 | log.error(e, e); |
| 542 | 0 | } |
| 543 | 0 | } |
| 544 | |
|
| 545 | |
|
| 546 | |
|
| 547 | |
|
| 548 | |
|
| 549 | |
|
| 550 | |
|
| 551 | |
|
| 552 | |
public static String getRoleName(Persistent obj) |
| 553 | |
{ |
| 554 | 0 | String name = null; |
| 555 | |
|
| 556 | 0 | if (obj == null) |
| 557 | |
{ |
| 558 | 0 | return null; |
| 559 | |
} |
| 560 | |
|
| 561 | |
try |
| 562 | |
{ |
| 563 | 0 | name = (String) namePropDesc |
| 564 | |
.getReadMethod() |
| 565 | |
.invoke(obj, new Object[] {}); |
| 566 | |
} |
| 567 | 0 | catch (ClassCastException cce) |
| 568 | |
{ |
| 569 | 0 | String msg = obj.getClass().getName() + " does not seem to be a Role Object!"; |
| 570 | 0 | log.error(msg); |
| 571 | 0 | throw new RuntimeException(msg); |
| 572 | |
} |
| 573 | 0 | catch (Exception e) |
| 574 | |
{ |
| 575 | 0 | log.error(e, e); |
| 576 | 0 | } |
| 577 | 0 | return name; |
| 578 | |
} |
| 579 | |
|
| 580 | |
|
| 581 | |
|
| 582 | |
|
| 583 | |
|
| 584 | |
|
| 585 | |
|
| 586 | |
public static void setId(Persistent obj, int id) |
| 587 | |
{ |
| 588 | 0 | if (obj == null) |
| 589 | |
{ |
| 590 | 0 | return; |
| 591 | |
} |
| 592 | |
|
| 593 | |
try |
| 594 | |
{ |
| 595 | 0 | Object[] params = new Object[] { Integer.TYPE }; |
| 596 | 0 | idPropDesc.getWriteMethod().invoke(obj, params); |
| 597 | |
} |
| 598 | 0 | catch (ClassCastException cce) |
| 599 | |
{ |
| 600 | 0 | String msg = obj.getClass().getName() + " does not seem to be a Role Object!"; |
| 601 | 0 | log.error(msg); |
| 602 | 0 | throw new RuntimeException(msg); |
| 603 | |
} |
| 604 | 0 | catch (Exception e) |
| 605 | |
{ |
| 606 | 0 | log.error(e, e); |
| 607 | 0 | } |
| 608 | 0 | } |
| 609 | |
|
| 610 | |
|
| 611 | |
|
| 612 | |
|
| 613 | |
|
| 614 | |
|
| 615 | |
|
| 616 | |
|
| 617 | |
public static Integer getIdAsObj(Persistent obj) |
| 618 | |
{ |
| 619 | 0 | Integer id = null; |
| 620 | |
|
| 621 | 0 | if (obj == null) |
| 622 | |
{ |
| 623 | 0 | return new Integer(0); |
| 624 | |
} |
| 625 | |
|
| 626 | |
try |
| 627 | |
{ |
| 628 | 0 | id = (Integer) idPropDesc |
| 629 | |
.getReadMethod() |
| 630 | |
.invoke(obj, new Object[] {}); |
| 631 | |
} |
| 632 | 0 | catch (ClassCastException cce) |
| 633 | |
{ |
| 634 | 0 | String msg = obj.getClass().getName() + " does not seem to be a Role Object!"; |
| 635 | 0 | log.error(msg); |
| 636 | 0 | throw new RuntimeException(msg); |
| 637 | |
} |
| 638 | 0 | catch (Exception e) |
| 639 | |
{ |
| 640 | 0 | log.error(e, e); |
| 641 | 0 | } |
| 642 | 0 | return id; |
| 643 | |
} |
| 644 | |
|
| 645 | |
|
| 646 | |
|
| 647 | |
|
| 648 | |
|
| 649 | |
|
| 650 | |
|
| 651 | |
|
| 652 | |
private static Class getPersistenceClass() |
| 653 | |
{ |
| 654 | 0 | Class persistenceClass = null; |
| 655 | |
|
| 656 | |
try |
| 657 | |
{ |
| 658 | 0 | Object[] params = new Object[0]; |
| 659 | |
|
| 660 | 0 | persistenceClass = (Class) rolePeerClass |
| 661 | |
.getMethod("getOMClass", (Class[])null) |
| 662 | |
.invoke(null, params); |
| 663 | |
} |
| 664 | 0 | catch (Exception e) |
| 665 | |
{ |
| 666 | 0 | persistenceClass = null; |
| 667 | 0 | } |
| 668 | |
|
| 669 | 0 | return persistenceClass; |
| 670 | |
} |
| 671 | |
|
| 672 | |
|
| 673 | |
|
| 674 | |
|
| 675 | |
|
| 676 | |
|
| 677 | |
|
| 678 | |
|
| 679 | |
|
| 680 | |
|
| 681 | |
|
| 682 | |
|
| 683 | |
|
| 684 | |
|
| 685 | |
public static Role getNewRole(Persistent p) |
| 686 | |
{ |
| 687 | 0 | Role r = null; |
| 688 | |
try |
| 689 | |
{ |
| 690 | 0 | Class roleWrapperClass = TurbineSecurity.getRoleClass(); |
| 691 | |
|
| 692 | 0 | Class [] clazz = new Class [] { Persistent.class }; |
| 693 | 0 | Object [] params = new Object [] { p }; |
| 694 | |
|
| 695 | 0 | r = (Role) roleWrapperClass |
| 696 | |
.getConstructor(clazz) |
| 697 | |
.newInstance(params); |
| 698 | |
} |
| 699 | 0 | catch (Exception e) |
| 700 | |
{ |
| 701 | 0 | log.error("Could not instantiate a new role from supplied persistent: ", e); |
| 702 | 0 | } |
| 703 | |
|
| 704 | 0 | return r; |
| 705 | |
} |
| 706 | |
} |
| 707 | |
|