FileDocCategorySizeDatePackage
DcerpcBinding.javaAPI DocJCIFS 1.3.17 API3343Tue Oct 18 15:26:24 BST 2011jcifs.dcerpc

DcerpcBinding

public class DcerpcBinding extends Object

Fields Summary
private static HashMap
INTERFACES
String
proto
String
server
String
endpoint
HashMap
options
UUID
uuid
int
major
int
minor
Constructors Summary
DcerpcBinding(String proto, String server)


        
        this.proto = proto;
        this.server = server;
    
Methods Summary
public static voidaddInterface(java.lang.String name, java.lang.String syntax)

        INTERFACES = new HashMap();
        INTERFACES.put("srvsvc", srvsvc.getSyntax());
        INTERFACES.put("lsarpc", lsarpc.getSyntax());
        INTERFACES.put("samr", samr.getSyntax());
        INTERFACES.put("netdfs", netdfs.getSyntax());
    
        INTERFACES.put(name, syntax);
    
java.lang.ObjectgetOption(java.lang.String key)

        if (key.equals("endpoint"))
            return endpoint;
        if (options != null)
            return options.get(key);
        return null;
    
voidsetOption(java.lang.String key, java.lang.Object val)

        if (key.equals("endpoint")) {
            endpoint = val.toString().toLowerCase();
            if (endpoint.startsWith("\\pipe\\")) {
                String iface = (String)INTERFACES.get(endpoint.substring(6));
                if (iface != null) {
                    int c, p;
                    c = iface.indexOf(':");
                    p = iface.indexOf('.", c + 1);
                    uuid = new UUID(iface.substring(0, c));
                    major = Integer.parseInt(iface.substring(c + 1, p));
                    minor = Integer.parseInt(iface.substring(p + 1));
                    return;
                }
            }
            throw new DcerpcException("Bad endpoint: " + endpoint);
        }
        if (options == null)
            options = new HashMap();
        options.put(key, val);
    
public java.lang.StringtoString()

        String ret = proto + ":" + server + "[" + endpoint;
        if (options != null) {
            Iterator iter = options.keySet().iterator();
            while (iter.hasNext()) {
                Object key = iter.next();
                Object val = options.get(key);
                ret += "," + key + "=" + val;
            }
        }
        ret += "]";
        return ret;