BridgeManagerResources bmr)
throws BridgeException,JMSException, Exception {
int msgtype = msg.getIntProperty(AdminMessageType.PropName.MESSAGE_TYPE);
if (msgtype != AdminMessageType.Type.START) {
throw new BridgeException(_bmr.getKString(_bmr.X_UNEXPECTED_ADMIN_MSG_TYPE,
AdminMessageType.getString(msgtype)));
}
String bnameval = msg.getStringProperty(AdminMessageType.PropName.BRIDGE_NAME);
String btypeval = msg.getStringProperty(AdminMessageType.PropName.BRIDGE_TYPE);
String lnameval = msg.getStringProperty(AdminMessageType.PropName.LINK_NAME);
String bname = (bnameval == null ? null: bnameval.trim());
String btype = (btypeval == null ? null: btypeval.trim().toUpperCase());
String lname = (lnameval == null ? null: lnameval.trim());
if (bname != null && lname != null) {
if (bname.length() == 0) {
throw new BridgeException(_bmr.getKString(_bmr.E_ADMIN_INVALID_BRIDGE_NAME, bname));
}
if (lname.trim().length() == 0) {
throw new BridgeException(_bmr.getKString(_bmr.E_ADMIN_INVALID_LINK_NAME, lname));
}
if (!_bsm.startBridge(bname, new String[]{"-ln", lname}, btype)) {
reply.setBooleanProperty(AdminMessageType.PropName.ASYNC_STARTED, Boolean.valueOf(true));
}
parent.sendReply(session, msg, reply, Status.OK, (String)null, bmr);
return;
}
if (lname != null) {
throw new BridgeException(_bmr.getKString(_bmr.X_ADMIN_LINK_NAME_NOSUPPORT, msg));
}
if (bname != null && bname.length() == 0) {
throw new BridgeException(_bmr.getKString(_bmr.E_ADMIN_INVALID_BRIDGE_NAME, bname));
}
if (!_bsm.startBridge(bname, null, btype)) {
reply.setBooleanProperty(AdminMessageType.PropName.ASYNC_STARTED, Boolean.valueOf(true));
}
parent.sendReply(session, msg, reply, Status.OK, (String)null, bmr);