Search in sources :

Example 1 with MysqlTarget

use of org.platformlayer.service.mysql.ops.MysqlTarget in project platformlayer by platformlayer.

the class MysqlConnection method doRecurseOperation.

@Override
public void doRecurseOperation() throws OpsException {
    MysqlServer mysqlServer = platformLayerHelpers.getItem(key, MysqlServer.class);
    String username = this.username;
    if (username == null) {
        username = "root";
        password = mysqlServer.rootPassword;
    }
    Machine machine = instanceHelpers.getMachine(mysqlServer);
    String address = machine.getNetworkPoint().getBestAddress(NetworkPoint.forTargetInContext());
    MysqlTarget mysql = new MysqlTarget(address, username, password);
    BindingScope scope = BindingScope.push(mysql);
    try {
        OpsContext opsContext = OpsContext.get();
        OperationRecursor.doRecurseChildren(opsContext, this);
    } finally {
        scope.pop();
    }
}
Also used : MysqlTarget(org.platformlayer.service.mysql.ops.MysqlTarget) OpsContext(org.platformlayer.ops.OpsContext) MysqlServer(org.platformlayer.service.mysql.model.MysqlServer) Machine(org.platformlayer.ops.Machine) BindingScope(org.platformlayer.ops.BindingScope)

Aggregations

BindingScope (org.platformlayer.ops.BindingScope)1 Machine (org.platformlayer.ops.Machine)1 OpsContext (org.platformlayer.ops.OpsContext)1 MysqlServer (org.platformlayer.service.mysql.model.MysqlServer)1 MysqlTarget (org.platformlayer.service.mysql.ops.MysqlTarget)1