use of org.cristalise.kernel.lookup.AgentPath in project kernel by cristal-ise.
the class BulkImport method importAgentPath.
public AgentPath importAgentPath(ItemPath item, Object locker) throws PersistencyException {
try {
AgentPath agentPath = (AgentPath) importCluster.get(item, PATH + "/Item");
Gateway.getLookupManager().add(agentPath);
Gateway.getLookupManager().setAgentPassword(agentPath, "aaa");
return agentPath;
} catch (ObjectCannotBeUpdated | ObjectAlreadyExistsException | CannotManageException | ObjectNotFoundException | NoSuchAlgorithmException e) {
Logger.error(e);
throw new PersistencyException(e.getMessage());
}
}
use of org.cristalise.kernel.lookup.AgentPath in project kernel by cristal-ise.
the class CastorXMLTest method testCastorAgentPath.
@Test
public void testCastorAgentPath() throws Exception {
CastorXMLUtility marshaller = Gateway.getMarshaller();
AgentPath agent = new AgentPath(UUID.randomUUID(), ior, "toto");
AgentPath agentPrime = (AgentPath) marshaller.unmarshall(marshaller.marshall(agent));
assertEquals(agent.getUUID(), agentPrime.getUUID());
assertEquals(agent.getIORString(), agentPrime.getIORString());
assertEquals(agent.getAgentName(), agentPrime.getAgentName());
Logger.msg(marshaller.marshall(agentPrime));
}
use of org.cristalise.kernel.lookup.AgentPath in project kernel by cristal-ise.
the class LookupPathClusterStorageTest method storeAgentPath.
@Test
public void storeAgentPath() throws Exception {
AgentPath agent = new AgentPath(UUID.randomUUID(), ior, "toto");
inMemoryCluster.put(storingItem, agent);
AgentPath agentPrime = (AgentPath) inMemoryCluster.get(storingItem, PATH + "/Agent");
assertNotNull(agentPrime);
assertEquals(agent.getUUID(), agentPrime.getUUID());
assertEquals(agent.getIORString(), agentPrime.getIORString());
assertEquals(agent.getAgentName(), agentPrime.getAgentName());
}
Aggregations