Exemplo n.º 1
0
def Create(chan, maxevs, bsize, objnm, idx, efn, tfn, constraints, mil, opr, vb):
    "stand-alone constructor"
    admin, proxy = CliUtils.get_proxy_for_con(CosNotifyChannelAdmin.SEQUENCE_EVENT, "push", opr,
					      CosNotifyChannelAdmin.SequenceProxyPushSupplier,
					      chan, objnm, vb)
    if (proxy == None):
	return None
    client = C(chan, admin, proxy, maxevs, bsize, objnm, idx, efn, tfn, mil, vb)
    b = client.L_add_filter("proxy", constraints)
    if (b == 1):
	try:
	    admin.destroy()
	except:
	    pass
	return None
    return client
Exemplo n.º 2
0
def Create(chan, maxevs, bsize, objnm, idx, efn, tfn, constraints, mil, opr, vb):
    "stand-alone constructor"
    if (bsize != 1):
	print "For AnyPushCon, batch size must be 1"
	bsize = 1
    admin, proxy = CliUtils.get_proxy_for_con(CosNotifyChannelAdmin.ANY_EVENT, "push", opr,
					      CosNotifyChannelAdmin.ProxyPushSupplier,
					      chan, objnm, vb)
    if (proxy == None):
	return None
    client = C(chan, admin, proxy, maxevs, bsize, objnm, idx, efn, tfn, mil, vb)
    b = client.L_add_filter("proxy", constraints)
    if (b == 1):
	try:
	    admin.destroy()
	except:
	    pass
	return None
    return client
Exemplo n.º 3
0
nqos = [prop]
chan = ChanUtils.get_channel_qos(fact, nqos, [], verbose)  # get new channel

if (chan != None):
    if (verbose > 0):
        print "FooTests: get_channel_qos OK"
        print_chan_properties(chan)
else:
    print "FooTests: chan not created -- unexpected!!"
    num_failed += 1

if (chan != None):
    if (verbose > 0):
        print "FooTests: chan was created -- getting admin, proxy"
    admin, proxy = CliUtils.get_proxy_for_con(
        CosNotifyChannelAdmin.STRUCTURED_EVENT, "push", "AND",
        CosNotifyChannelAdmin.StructuredProxyPushSupplier, chan, "FooTest",
        verbose)
    if (admin != None):
        if (verbose > 0):
            print "Trying set_qos on admin"
        num_tests += 1
        try:
            admin.set_qos(nqos)
            if (verbose > 0):
                print "Setting on admin worked, as expected"
        except CosNotification.UnsupportedQoS, eseqlist:
            if (verbose > 0):
                print "UnsupportedQoS exception -- unexpected!!"
                num_failed += 1
                for eseq in eseqlist:
                    PropUtils.print_propseq(eseq)