@Test public void testOpen() { try { UserAgentImpl a = UserAgentImpl.createUserAgent("passa"); UserAgentImpl b = UserAgentImpl.createUserAgent("passb"); BasicAgentStorage storage = new BasicAgentStorage(); storage.registerAgents(a, b); a.unlock("passa"); Message testee = new Message(a, b, "some content"); assertNull(testee.getSender()); assertNull(testee.getRecipient()); assertTrue(b.getIdentifier().equalsIgnoreCase(testee.getRecipientId())); assertEquals(a.getIdentifier(), testee.getSenderId()); b.unlock("passb"); testee.open(b, storage); assertNotSame(a, testee.getSender()); assertEquals(b, testee.getRecipient()); assertEquals(a.getIdentifier(), testee.getSender().getIdentifier()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); } }
public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message();  Message(AgentImpl from, AgentImpl to, Serializable data);  Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs);  Message(AgentImpl from, AgentImpl to, XmlAble data);  Message(AgentImpl from, AgentImpl to, XmlAble data, long timeoutMs);  Message(AgentImpl from, long topic, Serializable data);  Message(AgentImpl from, long topic, Serializable data, long timeoutMs);  Message(Message responseTo, XmlAble data, long timeoutMs);  Message(Message responseTo, XmlAble data);  Message(Message responseTo, Serializable data, long timeoutMs);  Message(Message responseTo, Serializable data); }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message();  Message(AgentImpl from, AgentImpl to, Serializable data);  Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs);  Message(AgentImpl from, AgentImpl to, XmlAble data);  Message(AgentImpl from, AgentImpl to, XmlAble data, long timeoutMs);  Message(AgentImpl from, long topic, Serializable data);  Message(AgentImpl from, long topic, Serializable data, long timeoutMs);  Message(Message responseTo, XmlAble data, long timeoutMs);  Message(Message responseTo, XmlAble data);  Message(Message responseTo, Serializable data, long timeoutMs);  Message(Message responseTo, Serializable data); AgentImpl getSender(); String getSenderId(); AgentImpl getRecipient(); String getRecipientId(); Long getTopicId(); boolean isTopic(); long getId(); Long getResponseToId(); boolean isResponse(); Object getContent(); void open(AgentStorage storage); void open(AgentImpl unlockedRecipient, AgentStorage storage); void open(AgentImpl unlockedRecipient, AgentStorage storage, ClassLoader contentClsLoader); void verifySignature(); void close(); boolean isOpen(); long getValidMs(); long getTimestamp(); Date getTimestampDate(); Date getTimeoutDate(); long getTimeoutTs(); boolean isExpired(); @Override String toXmlString(); void setStateFromXml(String xml); void setSendingNodeId(NodeHandle handle); void setSendingNodeId(Long id); void setRecipientId(String id); void setSendingNodeId(Object id); Serializable getSendingNodeId(); static Message createFromXml(String xml); @Override Message clone(); }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message();  Message(AgentImpl from, AgentImpl to, Serializable data);  Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs);  Message(AgentImpl from, AgentImpl to, XmlAble data);  Message(AgentImpl from, AgentImpl to, XmlAble data, long timeoutMs);  Message(AgentImpl from, long topic, Serializable data);  Message(AgentImpl from, long topic, Serializable data, long timeoutMs);  Message(Message responseTo, XmlAble data, long timeoutMs);  Message(Message responseTo, XmlAble data);  Message(Message responseTo, Serializable data, long timeoutMs);  Message(Message responseTo, Serializable data); AgentImpl getSender(); String getSenderId(); AgentImpl getRecipient(); String getRecipientId(); Long getTopicId(); boolean isTopic(); long getId(); Long getResponseToId(); boolean isResponse(); Object getContent(); void open(AgentStorage storage); void open(AgentImpl unlockedRecipient, AgentStorage storage); void open(AgentImpl unlockedRecipient, AgentStorage storage, ClassLoader contentClsLoader); void verifySignature(); void close(); boolean isOpen(); long getValidMs(); long getTimestamp(); Date getTimestampDate(); Date getTimeoutDate(); long getTimeoutTs(); boolean isExpired(); @Override String toXmlString(); void setStateFromXml(String xml); void setSendingNodeId(NodeHandle handle); void setSendingNodeId(Long id); void setRecipientId(String id); void setSendingNodeId(Object id); Serializable getSendingNodeId(); static Message createFromXml(String xml); @Override Message clone(); static final long DEFAULT_TIMEOUT; }