Search in sources :

Example 21 with AgentPath

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());
    }
}
Also used : CannotManageException(org.cristalise.kernel.common.CannotManageException) AgentPath(org.cristalise.kernel.lookup.AgentPath) ObjectNotFoundException(org.cristalise.kernel.common.ObjectNotFoundException) ObjectCannotBeUpdated(org.cristalise.kernel.common.ObjectCannotBeUpdated) PersistencyException(org.cristalise.kernel.common.PersistencyException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ObjectAlreadyExistsException(org.cristalise.kernel.common.ObjectAlreadyExistsException)

Example 22 with AgentPath

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));
}
Also used : AgentPath(org.cristalise.kernel.lookup.AgentPath) CastorXMLUtility(org.cristalise.kernel.utils.CastorXMLUtility) MainTest(org.cristalise.kernel.test.process.MainTest) Test(org.junit.Test)

Example 23 with AgentPath

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());
}
Also used : AgentPath(org.cristalise.kernel.lookup.AgentPath) Test(org.junit.Test)

Aggregations

AgentPath (org.cristalise.kernel.lookup.AgentPath)23 InvalidDataException (org.cristalise.kernel.common.InvalidDataException)10 ObjectNotFoundException (org.cristalise.kernel.common.ObjectNotFoundException)10 InvalidItemPathException (org.cristalise.kernel.lookup.InvalidItemPathException)8 CannotManageException (org.cristalise.kernel.common.CannotManageException)6 PersistencyException (org.cristalise.kernel.common.PersistencyException)6 ObjectAlreadyExistsException (org.cristalise.kernel.common.ObjectAlreadyExistsException)5 ObjectCannotBeUpdated (org.cristalise.kernel.common.ObjectCannotBeUpdated)5 RolePath (org.cristalise.kernel.lookup.RolePath)5 InvalidAgentPathException (org.cristalise.kernel.lookup.InvalidAgentPathException)4 IOException (java.io.IOException)3 AccessRightsException (org.cristalise.kernel.common.AccessRightsException)3 AgentProxy (org.cristalise.kernel.entity.proxy.AgentProxy)3 CompositeActivity (org.cristalise.kernel.lifecycle.instance.CompositeActivity)3 Workflow (org.cristalise.kernel.lifecycle.instance.Workflow)3 DomainPath (org.cristalise.kernel.lookup.DomainPath)3 ItemPath (org.cristalise.kernel.lookup.ItemPath)3 Viewpoint (org.cristalise.kernel.persistency.outcome.Viewpoint)3 Property (org.cristalise.kernel.property.Property)3 PropertyArrayList (org.cristalise.kernel.property.PropertyArrayList)3