1 18 package sync4j.framework.server.session; 19 20 37 38 import sync4j.framework.core.*; 39 import sync4j.framework.protocol.*; 40 import sync4j.framework.server.error.InvalidCredentialsException; 41 import sync4j.framework.engine.pipeline.MessageProcessingContext; 42 import sync4j.framework.engine.MessageSizeCalculator; 43 import sync4j.framework.server.error.ServerFailureException; 44 45 50 public interface SessionHandler { 51 52 54 public static final int STATE_START = 0x0000; 55 public static final int STATE_END = 0x0001; 56 public static final int STATE_PKG1_RECEIVING = 0x0002; 57 public static final int STATE_PKG1_RECEIVED = 0x0003; 58 public static final int STATE_PKG3_RECEIVING = 0x0004; 59 public static final int STATE_PKG3_RECEIVED = 0x0005; 60 public static final int STATE_SESSION_ABORTED = 0xFF01; 61 public static final int STATE_ERROR = 0xFFFF; 62 63 64 66 67 public String getSessionId(); 68 69 74 public boolean isNew(); 75 76 public void setNew(boolean newSession); 77 78 83 public boolean isAuthenticated(); 84 85 97 public SyncML processMessage(SyncML message, MessageProcessingContext context) 98 throws ProtocolException, InvalidCredentialsException, ServerFailureException; 99 100 116 public SyncML processError(SyncML msg, Throwable error) 117 throws Sync4jException; 118 119 123 public void expire(); 124 125 128 public long getCreationTimestamp(); 129 130 134 public void commit(); 135 136 143 public void abort(int statusCode); 144 145 150 public int getCurrentState(); 151 152 157 public void setSizeCalculator(MessageSizeCalculator calculator); 158 159 } 160 161 | Popular Tags |