Package jcifs.dcerpc
Class DcerpcHandle
- java.lang.Object
-
- jcifs.dcerpc.DcerpcHandle
-
- All Implemented Interfaces:
AutoCloseable
,DcerpcConstants
- Direct Known Subclasses:
DcerpcPipeHandle
public abstract class DcerpcHandle extends Object implements DcerpcConstants, AutoCloseable
-
-
Field Summary
-
Fields inherited from interface jcifs.dcerpc.DcerpcConstants
DCERPC_CONC_MPX, DCERPC_DID_NOT_EXECUTE, DCERPC_FIRST_FRAG, DCERPC_LAST_FRAG, DCERPC_MAYBE, DCERPC_OBJECT_UUID, DCERPC_PENDING_CANCEL, DCERPC_RESERVED_1, DCERPC_UUID_SYNTAX_NDR
-
-
Constructor Summary
Constructors Constructor Description DcerpcHandle(CIFSContext tc)
DcerpcHandle(CIFSContext tc, DcerpcBinding binding)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
bind()
Bind the handlevoid
close()
protected abstract int
doReceiveFragment(byte[] buf)
protected abstract void
doSendFragment(byte[] buf, int off, int length)
protected abstract int
doSendReceiveFragment(byte[] out, int off, int length, byte[] inB)
DcerpcBinding
getBinding()
static DcerpcHandle
getHandle(String url, CIFSContext tc)
Get a handle to a servicestatic DcerpcHandle
getHandle(String url, CIFSContext tc, boolean unshared)
Get a handle to a serviceabstract String
getServer()
abstract String
getServerWithDfs()
abstract byte[]
getSessionKey()
abstract CIFSContext
getTransportContext()
protected static DcerpcBinding
parseBinding(String str)
void
sendrecv(DcerpcMessage msg)
void
setDcerpcSecurityProvider(DcerpcSecurityProvider securityProvider)
String
toString()
-
-
-
Constructor Detail
-
DcerpcHandle
public DcerpcHandle(CIFSContext tc)
- Parameters:
tc
-
-
DcerpcHandle
public DcerpcHandle(CIFSContext tc, DcerpcBinding binding)
- Parameters:
tc
-binding
-
-
-
Method Detail
-
parseBinding
protected static DcerpcBinding parseBinding(String str) throws DcerpcException
- Throws:
DcerpcException
-
getBinding
public DcerpcBinding getBinding()
- Returns:
- the binding
-
getHandle
public static DcerpcHandle getHandle(String url, CIFSContext tc) throws MalformedURLException, DcerpcException
Get a handle to a service- Parameters:
url
-tc
- context to use- Returns:
- a DCERPC handle for the given url
- Throws:
MalformedURLException
DcerpcException
-
getHandle
public static DcerpcHandle getHandle(String url, CIFSContext tc, boolean unshared) throws MalformedURLException, DcerpcException
Get a handle to a service- Parameters:
url
-tc
-unshared
- whether an exclusive connection should be used- Returns:
- a DCERPC handle for the given url
- Throws:
MalformedURLException
DcerpcException
-
bind
public void bind() throws DcerpcException, IOException
Bind the handle- Throws:
DcerpcException
IOException
-
sendrecv
public void sendrecv(DcerpcMessage msg) throws DcerpcException, IOException
- Parameters:
msg
-- Throws:
DcerpcException
IOException
-
setDcerpcSecurityProvider
public void setDcerpcSecurityProvider(DcerpcSecurityProvider securityProvider)
- Parameters:
securityProvider
-
-
getServer
public abstract String getServer()
- Returns:
- the server connected to
-
getServerWithDfs
public abstract String getServerWithDfs()
- Returns:
- the server resolved by DFS
-
getTransportContext
public abstract CIFSContext getTransportContext()
- Returns:
- the transport context used
-
getSessionKey
public abstract byte[] getSessionKey() throws CIFSException
- Returns:
- session key of the underlying smb session
- Throws:
CIFSException
-
doSendFragment
protected abstract void doSendFragment(byte[] buf, int off, int length) throws IOException
- Throws:
IOException
-
doReceiveFragment
protected abstract int doReceiveFragment(byte[] buf) throws IOException
- Throws:
IOException
-
doSendReceiveFragment
protected abstract int doSendReceiveFragment(byte[] out, int off, int length, byte[] inB) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-