1 31 package org.objectweb.proactive.ext.security; 32 33 import java.io.Serializable ; 34 35 import java.util.ArrayList ; 36 37 38 44 public class SecurityContext implements Serializable { 45 public static int COMMUNICATION_SEND_REQUEST_TO = 0; 46 public static int COMMUNICATION_RECEIVE_REQUEST_FROM = 1; 47 public static int COMMUNICATION_SEND_REPLY_TO = 2; 48 public static int COMMUNICATION_RECEIVE_REPLY_FROM = 3; 49 public static int MIGRATION_TO = 4; 50 public static int MIGRATION_FROM = 5; 51 protected ArrayList entitiesFrom; 52 protected ArrayList entitiesTo; 53 protected Communication sendRequest; 54 protected Communication receiveRequest; 55 protected Communication sendReply; 56 protected Communication receiveReply; 57 protected boolean migration; 58 protected boolean migrationTo; 59 protected boolean creationActiveObjectFrom; 60 protected boolean creationActiveObjectTo; 61 protected int type; 62 63 public SecurityContext() { 64 } 65 66 public SecurityContext(int type, ArrayList entitiesFrom, 67 ArrayList entitiesTo) { 68 this.type = type; 69 this.entitiesFrom = entitiesFrom; 70 this.entitiesTo = entitiesTo; 71 } 72 73 public void addEntityFrom(Entity entity) { 74 entitiesFrom.add(entity); 75 } 76 77 public void addEntityTo(Entity entity) { 78 entitiesTo.add(entity); 79 } 80 81 84 public int getType() { 85 return type; 86 } 87 88 91 public void setType(int i) { 92 type = i; 93 } 94 95 98 public boolean isCreationActiveObjectFrom() { 99 return creationActiveObjectFrom; 100 } 101 102 105 public boolean isCreationActiveObjectTo() { 106 return creationActiveObjectTo; 107 } 108 109 112 public ArrayList getEntitiesFrom() { 113 return entitiesFrom; 114 } 115 116 119 public ArrayList getEntitiesTo() { 120 return entitiesTo; 121 } 122 123 126 public boolean isMigration() { 127 return migration; 128 } 129 130 133 public Communication getReceiveReply() { 134 return receiveReply; 135 } 136 137 140 public Communication getReceiveRequest() { 141 return receiveRequest; 142 } 143 144 147 public Communication getSendReply() { 148 return sendReply; 149 } 150 151 154 public Communication getSendRequest() { 155 return sendRequest; 156 } 157 158 161 public void setCreationActiveObjectFrom(boolean b) { 162 creationActiveObjectFrom = b; 163 } 164 165 168 public void setCreationActiveObjectTo(boolean b) { 169 creationActiveObjectTo = b; 170 } 171 172 175 public void setEntitiesFrom(ArrayList list) { 176 entitiesFrom = list; 177 } 178 179 182 public void setEntitiesTo(ArrayList list) { 183 entitiesTo = list; 184 } 185 186 189 public void setMigration(boolean b) { 190 migration = b; 191 } 192 193 196 public void setMigrationTo(boolean b) { 197 migrationTo = b; 198 } 199 200 203 public void setReceiveReply(Communication communication) { 204 receiveReply = communication; 205 } 206 207 210 public void setReceiveRequest(Communication communication) { 211 receiveRequest = communication; 212 } 213 214 217 public void setSendReply(Communication communication) { 218 sendReply = communication; 219 } 220 221 224 public void setSendRequest(Communication communication) { 225 sendRequest = communication; 226 } 227 } 228 | Popular Tags |