org/objectweb/proactive/ext/security/SecurityContext.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.ext.security;
00032 
00033 import java.io.Serializable;
00034 import java.util.ArrayList;
00035 
00036 import org.objectweb.proactive.ext.security.securityentity.Entity;
00037 
00038 
00043 public class SecurityContext implements Serializable {
00044     public static int COMMUNICATION_SEND_REQUEST_TO = 0;
00045     public static int COMMUNICATION_RECEIVE_REQUEST_FROM = 1;
00046     public static int COMMUNICATION_SEND_REPLY_TO = 2;
00047     public static int COMMUNICATION_RECEIVE_REPLY_FROM = 3;
00048     public static int MIGRATION_TO = 4;
00049     public static int MIGRATION_FROM = 5;
00050     public static int Validate_POLICY = 5;
00051     protected ArrayList<Entity> entitiesFrom;
00052     protected ArrayList<Entity> entitiesTo;
00053     protected Communication sendRequest;
00054     protected Communication receiveRequest;
00055     protected Communication sendReply;
00056     protected Communication receiveReply;
00057     protected Communication proposedPolicy;
00058     protected int proposedPolicyValidated;
00059     protected boolean migration;
00060     protected boolean migrationTo;
00061     protected boolean creationActiveObjectFrom;
00062     protected boolean creationActiveObjectTo;
00063     protected int type;
00064     protected long sessionID;
00065 
00066     public SecurityContext() {
00067     }
00068 
00069     public SecurityContext(int type, ArrayList<Entity> entitiesFrom,
00070         ArrayList<Entity> entitiesTo) {
00071         this.type = type;
00072         this.entitiesFrom = entitiesFrom;
00073         this.entitiesTo = entitiesTo;
00074     }
00075 
00076     public void addEntityFrom(Entity entity) {
00077         entitiesFrom.add(entity);
00078     }
00079 
00080     public void addEntityTo(Entity entity) {
00081         entitiesTo.add(entity);
00082     }
00083 
00087     public int getType() {
00088         return type;
00089     }
00090 
00095     public void setType(int i) {
00096         type = i;
00097     }
00098 
00102     public boolean isCreationActiveObjectFrom() {
00103         return creationActiveObjectFrom;
00104     }
00105 
00109     public boolean isCreationActiveObjectTo() {
00110         return creationActiveObjectTo;
00111     }
00112 
00116     public ArrayList<Entity> getEntitiesFrom() {
00117         return entitiesFrom;
00118     }
00119 
00123     public ArrayList<Entity> getEntitiesTo() {
00124         return entitiesTo;
00125     }
00126 
00130     public boolean isMigration() {
00131         return migration;
00132     }
00133 
00137     public Communication getReceiveReply() {
00138         return receiveReply;
00139     }
00140 
00144     public Communication getReceiveRequest() {
00145         return receiveRequest;
00146     }
00147 
00151     public Communication getSendReply() {
00152         return sendReply;
00153     }
00154 
00158     public Communication getSendRequest() {
00159         return sendRequest;
00160     }
00161 
00165     public void setCreationActiveObjectFrom(boolean b) {
00166         creationActiveObjectFrom = b;
00167     }
00168 
00172     public void setCreationActiveObjectTo(boolean b) {
00173         creationActiveObjectTo = b;
00174     }
00175 
00179     public void setEntitiesFrom(ArrayList<Entity> list) {
00180         entitiesFrom = list;
00181     }
00182 
00186     public void setEntitiesTo(ArrayList<Entity> list) {
00187         entitiesTo = list;
00188     }
00189 
00193     public void setMigration(boolean b) {
00194         migration = b;
00195     }
00196 
00200     public void setMigrationTo(boolean b) {
00201         migrationTo = b;
00202     }
00203 
00207     public void setReceiveReply(Communication communication) {
00208         receiveReply = communication;
00209     }
00210 
00214     public void setReceiveRequest(Communication communication) {
00215         receiveRequest = communication;
00216     }
00217 
00221     public void setSendReply(Communication communication) {
00222         sendReply = communication;
00223     }
00224 
00228     public void setSendRequest(Communication communication) {
00229         sendRequest = communication;
00230     }
00231 
00235     public long getSessionID() {
00236         return sessionID;
00237     }
00238 
00242     public void setSessionID(long sessionID) {
00243         this.sessionID = sessionID;
00244     }
00245 
00249     public boolean isMigrationTo() {
00250         return migrationTo;
00251     }
00252 
00256     public Communication getProposedPolicy() {
00257         return proposedPolicy;
00258     }
00259 
00263     public void setProposedPolicy(Communication proposedPolicy) {
00264         this.proposedPolicy = proposedPolicy;
00265     }
00266 
00270     public int getProposedPolicyValidated() {
00271         return proposedPolicyValidated;
00272     }
00273 
00277     public void setProposedPolicyValidated(int proposedPolicyValidated) {
00278         this.proposedPolicyValidated = proposedPolicyValidated;
00279     }
00280 }

Generated on Mon Jan 22 15:16:11 2007 for ProActive by  doxygen 1.5.1