Search in sources :

Example 1 with ClusterDatabaseInfo

use of org.neo4j.management.ClusterDatabaseInfo in project neo4j by neo4j.

the class ClusterDatabaseInfoProvider method getInfo.

public ClusterDatabaseInfo getInfo() {
    ClusterMember currentMember = members.getCurrentMember();
    if (currentMember == null) {
        return null;
    }
    Function<Object, String> nullSafeToString = from -> from == null ? "" : from.toString();
    return new ClusterDatabaseInfo(new ClusterMemberInfo(currentMember.getInstanceId().toString(), currentMember.getHAUri() != null, true, currentMember.getHARole(), Iterables.asArray(String.class, Iterables.map(nullSafeToString, currentMember.getRoleURIs())), Iterables.asArray(String.class, Iterables.map(nullSafeToString, currentMember.getRoles()))), txIdGetter.getLastTxId(), lastUpdateTime.getLastUpdateTime());
}
Also used : ClusterMembers(org.neo4j.kernel.ha.cluster.member.ClusterMembers) Iterables(org.neo4j.helpers.collection.Iterables) LastUpdateTime(org.neo4j.kernel.ha.LastUpdateTime) ClusterMemberInfo(org.neo4j.management.ClusterMemberInfo) ClusterDatabaseInfo(org.neo4j.management.ClusterDatabaseInfo) Function(java.util.function.Function) ClusterMember(org.neo4j.kernel.ha.cluster.member.ClusterMember) LastTxIdGetter(org.neo4j.kernel.impl.core.LastTxIdGetter) ClusterMember(org.neo4j.kernel.ha.cluster.member.ClusterMember) ClusterMemberInfo(org.neo4j.management.ClusterMemberInfo) ClusterDatabaseInfo(org.neo4j.management.ClusterDatabaseInfo)

Aggregations

Function (java.util.function.Function)1 Iterables (org.neo4j.helpers.collection.Iterables)1 LastUpdateTime (org.neo4j.kernel.ha.LastUpdateTime)1 ClusterMember (org.neo4j.kernel.ha.cluster.member.ClusterMember)1 ClusterMembers (org.neo4j.kernel.ha.cluster.member.ClusterMembers)1 LastTxIdGetter (org.neo4j.kernel.impl.core.LastTxIdGetter)1 ClusterDatabaseInfo (org.neo4j.management.ClusterDatabaseInfo)1 ClusterMemberInfo (org.neo4j.management.ClusterMemberInfo)1