use of org.alfresco.sync.repo.Client in project alfresco-repository by Alfresco.
the class ClientUtilTest method testClientType.
@Test
public void testClientType() {
Client client = Client.asType(null);
assertNotNull(client);
}
use of org.alfresco.sync.repo.Client in project alfresco-repository by Alfresco.
the class ClientUtilTest method testFileFilterModeConversion.
/**
* If a new client is added to the FileFilterMode.Client then this unit test will
* throw a IllegalArgument exception. To fix it you will need to add to the
* org.alfresco.sync.events.Client.ClientType.
*/
@Test
public void testFileFilterModeConversion() {
// Loop through all the client types checking they work
for (FileFilterMode.Client client : FileFilterMode.Client.values()) {
equalsConversion(client);
}
org.alfresco.sync.repo.Client client = ClientUtil.from(null);
assertNull(client);
}
use of org.alfresco.sync.repo.Client in project alfresco-repository by Alfresco.
the class EventsServiceImpl method nodeUpdated.
@Override
public void nodeUpdated(final NodeRef nodeRef, final Map<String, Property> propertiesAdded, final Set<String> propertiesRemoved, final Map<String, Property> propertiesChanged, final Set<String> aspectsAdded, final Set<String> aspectsRemoved) {
NodeInfo nodeInfo = getNodeInfo(nodeRef, NodeUpdatedEvent.EVENT_TYPE);
if (nodeInfo.checkNodeInfo()) {
String username = AuthenticationUtil.getFullyAuthenticatedUser();
String networkId = TenantUtil.getCurrentDomain();
String name = nodeInfo.getName();
String objectId = nodeInfo.getNodeId();
String siteId = nodeInfo.getSiteId();
String txnId = AlfrescoTransactionSupport.getTransactionId();
List<String> nodePaths = nodeInfo.getPaths();
List<List<String>> pathNodeIds = nodeInfo.getParentNodeIds();
long timestamp = System.currentTimeMillis();
Long modificationTime = nodeInfo.getModificationTimestamp();
String nodeType = nodeInfo.getType().toPrefixString(namespaceService);
Client alfrescoClient = getAlfrescoClient(nodeInfo.getClient());
Set<String> aspects = nodeInfo.getAspectsAsStrings();
Map<String, Serializable> properties = nodeInfo.getProperties();
Event event = new NodeUpdatedEvent(nextSequenceNumber(), name, txnId, timestamp, networkId, siteId, objectId, nodeType, nodePaths, pathNodeIds, username, modificationTime, propertiesAdded, propertiesRemoved, propertiesChanged, aspectsAdded, aspectsRemoved, alfrescoClient, aspects, properties);
sendEvent(event);
}
}
use of org.alfresco.sync.repo.Client in project alfresco-repository by Alfresco.
the class EventsServiceImpl method nodeTagRemoved.
@Override
public void nodeTagRemoved(final NodeRef nodeRef, final String tag) {
NodeInfo nodeInfo = getNodeInfo(nodeRef, NodeUnTaggedEvent.EVENT_TYPE);
if (nodeInfo.checkNodeInfo()) {
String username = AuthenticationUtil.getFullyAuthenticatedUser();
String networkId = TenantUtil.getCurrentDomain();
String name = nodeInfo.getName();
String objectId = nodeInfo.getNodeId();
String siteId = nodeInfo.getSiteId();
String txnId = AlfrescoTransactionSupport.getTransactionId();
List<String> nodePaths = nodeInfo.getPaths();
List<List<String>> pathNodeIds = nodeInfo.getParentNodeIds();
long timestamp = System.currentTimeMillis();
Long modificationTime = nodeInfo.getModificationTimestamp();
String nodeType = nodeInfo.getType().toPrefixString(namespaceService);
Set<String> aspects = nodeInfo.getAspectsAsStrings();
Map<String, Serializable> properties = nodeInfo.getProperties();
Client alfrescoClient = getAlfrescoClient(nodeInfo.getClient());
Event event = new NodeUnTaggedEvent(nextSequenceNumber(), tag, name, txnId, timestamp, networkId, siteId, objectId, nodeType, nodePaths, pathNodeIds, username, modificationTime, alfrescoClient, aspects, properties);
sendEvent(event);
}
}
use of org.alfresco.sync.repo.Client in project alfresco-repository by Alfresco.
the class EventsServiceImpl method nodeCheckedIn.
public void nodeCheckedIn(NodeRef nodeRef) {
NodeInfo nodeInfo = getNodeInfo(nodeRef, NodeCheckedInEvent.EVENT_TYPE);
if (nodeInfo.checkNodeInfo()) {
String username = AuthenticationUtil.getFullyAuthenticatedUser();
String networkId = TenantUtil.getCurrentDomain();
String name = nodeInfo.getName();
String objectId = nodeInfo.getNodeId();
String siteId = nodeInfo.getSiteId();
String txnId = AlfrescoTransactionSupport.getTransactionId();
List<String> nodePaths = nodeInfo.getPaths();
List<List<String>> pathNodeIds = nodeInfo.getParentNodeIds();
long timestamp = System.currentTimeMillis();
Long modificationTime = nodeInfo.getModificationTimestamp();
String nodeType = nodeInfo.getType().toPrefixString(namespaceService);
Client alfrescoClient = getAlfrescoClient(nodeInfo.getClient());
Set<String> aspects = nodeInfo.getAspectsAsStrings();
Map<String, Serializable> properties = nodeInfo.getProperties();
Event event = new NodeCheckedInEvent(nextSequenceNumber(), name, txnId, timestamp, networkId, siteId, objectId, nodeType, nodePaths, pathNodeIds, username, modificationTime, alfrescoClient, aspects, properties);
sendEvent(event);
}
}
Aggregations