Brocade Virtual ADX XML API Programmer’s Guide (Supporting ADX v03.1.00) User Manual

Page 867

Advertising
background image

Brocade Virtual ADX XML API Programmer’s Guide

857

53-1003248-01

Example: Unbinding a real server from a VIP

B

System.out.println("Successfully created virtual server port [ "

+ virtualServerPort + " ]");

return virtualPort;

}

/**

* Bind Real port to virtual port

*

* @param virtualPort

* @param realPort

* @throws RuntimeFault_datatype

* @throws RemoteException

*/

public void bind(ServerPort virtualPort, ServerPort realPort)

throws RuntimeFault_datatype, RemoteException {

BindRealServerPortToVipPort_datatype arg0 = new

BindRealServerPortToVipPort_datatype(

virtualPort, realPort);

RequestHeader_datatype arg1 = new RequestHeader_datatype();

slbService.bindRealServerPortToVipPort(arg0, arg1);

System.out.println("Successfully binded real port [ "

+ realPort.getPort().getNameOrNumber()

+ " ] to virtual port [ "

+ virtualPort.getPort().getNameOrNumber() + " ]");

}

/**

* Save configuration

*

* @throws RuntimeFault_datatype

* @throws RemoteException

*/

public void saveConfiguration() throws RuntimeFault_datatype,

RemoteException {

RequestHeader_datatype rhold = new RequestHeader_datatype();

WriteConfig_datatype wcon = new WriteConfig_datatype();

sysService.writeConfig(wcon, rhold);

System.out.println("Successfully saved configuration");

}

/**

* unBind Real Server Port

*

* @throws RuntimeFault_datatype

* @throws RemoteException

*/

public void unBindRealServerport(ServerPort virtualPort, ServerPort realPort)

throws RuntimeFault_datatype, RemoteException {

// slbService.unbindRealServerPortFromVipPort(virtualPort, realPort);

UnbindRealServerPortFromVipPort_datatype arg0 = new

UnbindRealServerPortFromVipPort_datatype(

virtualPort, realPort);

RequestHeader_datatype arg1 = new RequestHeader_datatype();

slbService.unbindRealServerPortFromVipPort(arg0, arg1);

System.out.println("Successfully unBinded the "

+ realPort.getPort().getNameOrNumber() + " from "

+ virtualPort.getPort().getNameOrNumber());

}

Advertising