1 package de.webman.acl; 2 3 import com.teamkonzept.lib.TKException; 4 import com.teamkonzept.lib.TKVector; 5 import de.webman.acl.db.RoleDBData; 6 7 14 public class Role 15 extends WMObject 16 { 17 18 20 22 25 private String name = null; 26 27 28 30 35 protected Role (RoleDBData data) 36 { 37 super(data); 38 39 this.name = data.getName(); 40 } 41 42 43 45 51 public final ObjectFactory getFactory () 52 throws TKException 53 { 54 return RoleFactory.getInstance(); 55 } 56 57 62 public final String getName () 63 { 64 return name; 65 } 66 67 72 public final void setName (String name) 73 { 74 super.modifyAttribute(this.name, name); 75 this.name = name; 76 } 77 78 84 public final TKVector getTasks () 85 throws TKException 86 { 87 return TaskFactory.getInstance().getObjects(super.getAssociations()); 88 } 89 90 96 public final void addTask (Task task) 97 throws TKException 98 { 99 super.addAssociation(task); 100 } 101 102 108 public final void removeTask (Task task) 109 throws TKException 110 { 111 super.removeAssociation(task); 112 } 113 114 122 public final boolean hasTask (Task task) 123 throws TKException 124 { 125 return super.containsAssociation(task); 126 } 127 128 133 public final void removeTasks () 134 throws TKException 135 { 136 super.removeAssociations(); 137 } 138 139 } 140 | Popular Tags |