Search in sources :

Example 1 with UsernamePasswordToken

use of org.yamcs.security.UsernamePasswordToken in project yamcs-studio by yamcs.

the class YamcsConfiguration method getFailoverConnectionProperties.

public YamcsConnectionProperties getFailoverConnectionProperties() {
    if (failoverHost != null) {
        YamcsConnectionProperties yprops = new YamcsConnectionProperties(failoverHost, failoverPort, instance);
        yprops.setProtocol(Protocol.http);
        if (!isAnonymous()) {
            yprops.setAuthenticationToken(new UsernamePasswordToken(user, password));
        }
        return yprops;
    } else {
        return null;
    }
}
Also used : YamcsConnectionProperties(org.yamcs.api.YamcsConnectionProperties) UsernamePasswordToken(org.yamcs.security.UsernamePasswordToken)

Example 2 with UsernamePasswordToken

use of org.yamcs.security.UsernamePasswordToken in project yamcs-studio by yamcs.

the class YamcsConfiguration method getPrimaryConnectionProperties.

public YamcsConnectionProperties getPrimaryConnectionProperties() {
    YamcsConnectionProperties yprops = new YamcsConnectionProperties(primaryHost, primaryPort, instance);
    yprops.setProtocol(Protocol.http);
    if (!isAnonymous()) {
        yprops.setAuthenticationToken(new UsernamePasswordToken(user, password));
    }
    return yprops;
}
Also used : YamcsConnectionProperties(org.yamcs.api.YamcsConnectionProperties) UsernamePasswordToken(org.yamcs.security.UsernamePasswordToken)

Aggregations

YamcsConnectionProperties (org.yamcs.api.YamcsConnectionProperties)2 UsernamePasswordToken (org.yamcs.security.UsernamePasswordToken)2