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 voidbind()Bind the handlevoidclose()protected abstract intdoReceiveFragment(byte[] buf)protected abstract voiddoSendFragment(byte[] buf, int off, int length)protected abstract intdoSendReceiveFragment(byte[] out, int off, int length, byte[] inB)DcerpcBindinggetBinding()static DcerpcHandlegetHandle(String url, CIFSContext tc)Get a handle to a servicestatic DcerpcHandlegetHandle(String url, CIFSContext tc, boolean unshared)Get a handle to a serviceabstract StringgetServer()abstract StringgetServerWithDfs()abstract byte[]getSessionKey()abstract CIFSContextgetTransportContext()protected static DcerpcBindingparseBinding(String str)voidsendrecv(DcerpcMessage msg)voidsetDcerpcSecurityProvider(DcerpcSecurityProvider securityProvider)StringtoString()
-
-
-
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:
MalformedURLExceptionDcerpcException
-
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:
MalformedURLExceptionDcerpcException
-
bind
public void bind() throws DcerpcException, IOExceptionBind the handle- Throws:
DcerpcExceptionIOException
-
sendrecv
public void sendrecv(DcerpcMessage msg) throws DcerpcException, IOException
- Parameters:
msg-- Throws:
DcerpcExceptionIOException
-
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:
closein interfaceAutoCloseable- Throws:
IOException
-
-