01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.ha.hasessionstate.interfaces;
23:
24: import java.io.Serializable;
25:
26: /**
27: * Information about a session that is shared by nodes in a same sub-partition
28: *
29: * @see HASessionState, PackagedSessionImpl
30: * @author sacha.labourey@cogito-info.ch
31: * @version $Revision: 57188 $
32: *
33: * <p><b>Revisions:</b><br>
34: */
35:
36: public interface PackagedSession extends Serializable {
37: /** The serialVersionUID
38: * @since 1.2
39: */
40: static final long serialVersionUID = 689622988452110553L;
41:
42: /*
43: * Stored state
44: */
45: public byte[] getState();
46:
47: public boolean setState(byte[] state);
48:
49: /*
50: * Stored state
51: */
52: public boolean isStateIdentical(byte[] state);
53:
54: /*
55: * Update the state and content of this PackagedSession from the content of another
56: * PackagedSession.
57: */
58: public void update(PackagedSession clone);
59:
60: /*
61: * Owner node of the state
62: */
63: public String getOwner();
64:
65: public void setOwner(String owner);
66:
67: /*
68: * Version number of this state
69: */
70: public long getVersion();
71:
72: /*
73: * Key identifier associated with this state
74: */
75: public Serializable getKey();
76:
77: public void setKey(Serializable key);
78:
79: /*
80: * Number of miliseconds since when this state has not been modified in this VM
81: */
82: public long unmodifiedExistenceInVM();
83: }
|