Search in sources :

Example 1 with CLUSTERING_NODE_REGISTRATION

use of org.craftercms.studio.api.v2.utils.StudioConfiguration.CLUSTERING_NODE_REGISTRATION in project studio by craftercms.

the class GitContentRepository method insertClusterRemoteRepository.

public void insertClusterRemoteRepository(RemoteRepository remoteRepository) {
    HierarchicalConfiguration<ImmutableNode> registrationData = studioConfiguration.getSubConfig(CLUSTERING_NODE_REGISTRATION);
    if (registrationData != null && !registrationData.isEmpty()) {
        String localAddress = registrationData.getString(CLUSTER_MEMBER_LOCAL_ADDRESS);
        ClusterMember member = clusterDao.getMemberByLocalAddress(localAddress);
        if (member != null) {
            retryingOperationFacade.addClusterRemoteRepository(member.getId(), remoteRepository.getId());
        }
    }
}
Also used : ClusterMember(org.craftercms.studio.api.v2.dal.ClusterMember) ImmutableNode(org.apache.commons.configuration2.tree.ImmutableNode)

Example 2 with CLUSTERING_NODE_REGISTRATION

use of org.craftercms.studio.api.v2.utils.StudioConfiguration.CLUSTERING_NODE_REGISTRATION in project studio by craftercms.

the class GitContentRepository method insertClusterRemoteRepository.

@RetryingOperation
public void insertClusterRemoteRepository(RemoteRepository remoteRepository) {
    HierarchicalConfiguration<ImmutableNode> registrationData = studioConfiguration.getSubConfig(CLUSTERING_NODE_REGISTRATION);
    if (registrationData != null && !registrationData.isEmpty()) {
        String localAddress = registrationData.getString(CLUSTER_MEMBER_LOCAL_ADDRESS);
        ClusterMember member = clusterDao.getMemberByLocalAddress(localAddress);
        if (member != null) {
            clusterDao.addClusterRemoteRepository(member.getId(), remoteRepository.getId());
        }
    }
}
Also used : ClusterMember(org.craftercms.studio.api.v2.dal.ClusterMember) ImmutableNode(org.apache.commons.configuration2.tree.ImmutableNode) RetryingOperation(org.craftercms.studio.api.v2.annotation.RetryingOperation)

Example 3 with CLUSTERING_NODE_REGISTRATION

use of org.craftercms.studio.api.v2.utils.StudioConfiguration.CLUSTERING_NODE_REGISTRATION in project studio by craftercms.

the class AuditServiceInternalImpl method createAuditLogEntry.

@Override
public AuditLog createAuditLogEntry() {
    AuditLog auditLog = new AuditLog();
    String clusterNodeId = StringUtils.EMPTY;
    HierarchicalConfiguration<ImmutableNode> clusterNodeData = studioConfiguration.getSubConfig(CLUSTERING_NODE_REGISTRATION);
    if (clusterNodeData != null && !clusterNodeData.isEmpty()) {
        clusterNodeId = clusterNodeData.getString(CLUSTER_MEMBER_LOCAL_ADDRESS);
    }
    auditLog.setOrganizationId(1);
    auditLog.setOrigin(ORIGIN_API);
    auditLog.setClusterNodeId(clusterNodeId);
    return auditLog;
}
Also used : ImmutableNode(org.apache.commons.configuration2.tree.ImmutableNode) AuditLog(org.craftercms.studio.api.v2.dal.AuditLog)

Aggregations

ImmutableNode (org.apache.commons.configuration2.tree.ImmutableNode)3 ClusterMember (org.craftercms.studio.api.v2.dal.ClusterMember)2 RetryingOperation (org.craftercms.studio.api.v2.annotation.RetryingOperation)1 AuditLog (org.craftercms.studio.api.v2.dal.AuditLog)1