1 17 package org.alfresco.filesys.smb.dcerpc.server; 18 19 import java.io.IOException ; 20 21 import org.alfresco.filesys.server.filesys.NetworkFile; 22 import org.alfresco.filesys.smb.dcerpc.DCEBuffer; 23 import org.alfresco.filesys.smb.dcerpc.DCEPipeType; 24 25 30 public class DCEPipeFile extends NetworkFile 31 { 32 33 35 private int m_maxRxFragSize; 36 private int m_maxTxFragSize; 37 38 40 private int m_state; 41 42 44 private DCEHandler m_handler; 45 46 48 private DCEBuffer m_dceData; 49 50 55 public DCEPipeFile(int id) 56 { 57 super(id); 58 setName(DCEPipeType.getTypeAsString(id)); 59 60 62 setRequestHandler(DCEPipeHandler.getHandlerForType(id)); 63 } 64 65 70 public final int getMaxReceiveFragmentSize() 71 { 72 return m_maxRxFragSize; 73 } 74 75 80 public final int getMaxTransmitFragmentSize() 81 { 82 return m_maxTxFragSize; 83 } 84 85 90 public final int getPipeState() 91 { 92 return m_state; 93 } 94 95 100 public final int getPipeId() 101 { 102 return getFileId(); 103 } 104 105 110 public final boolean hasRequestHandler() 111 { 112 return m_handler != null ? true : false; 113 } 114 115 120 public final DCEHandler getRequestHandler() 121 { 122 return m_handler; 123 } 124 125 130 public final boolean hasBufferedData() 131 { 132 return m_dceData != null ? true : false; 133 } 134 135 140 public final DCEBuffer getBufferedData() 141 { 142 return m_dceData; 143 } 144 145 150 public final void setBufferedData(DCEBuffer buf) 151 { 152 m_dceData = buf; 153 } 154 155 160 public final void setMaxReceiveFragmentSize(int siz) 161 { 162 m_maxRxFragSize = siz; 163 } 164 165 170 public final void setMaxTransmitFragmentSize(int siz) 171 { 172 m_maxTxFragSize = siz; 173 } 174 175 180 public final void setPipeState(int state) 181 { 182 m_state = state; 183 } 184 185 190 public final void setRequestHandler(DCEHandler handler) 191 { 192 m_handler = handler; 193 } 194 195 198 public final void DumpFile() 199 { 200 System.out.println("** DCE/RPC Named Pipe: " + getName()); 201 System.out.println(" File ID : " + getFileId()); 202 System.out.println(" State : 0x" + Integer.toHexString(getPipeState())); 203 System.out.println(" Max Rx : " + getMaxReceiveFragmentSize()); 204 System.out.println(" Max Tx : " + getMaxTransmitFragmentSize()); 205 System.out.println(" Handler : " + getRequestHandler()); 206 } 207 208 211 public void closeFile() throws IOException 212 { 213 } 214 215 218 public void openFile(boolean createFlag) throws IOException 219 { 220 } 221 222 225 public int readFile(byte[] buf, int len, int pos, long fileOff) throws IOException 226 { 227 return 0; 228 } 229 230 235 public void flushFile() throws IOException 236 { 237 } 238 239 242 public long seekFile(long pos, int typ) throws IOException 243 { 244 return 0; 245 } 246 247 250 public void truncateFile(long siz) throws IOException 251 { 252 } 253 254 257 public void writeFile(byte[] buf, int len, int pos, long fileOff) throws IOException 258 { 259 } 260 } | Popular Tags |