Examples of AgentInfo


Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

  public AgentInfo unpackageAgent(byte[] packageFile)
  {
    try
    {
      // get AgentInfo
      AgentInfo agentInfo =
        ContainerManager.getInstance().getContainer().createAgentInfo();

      // deserialize Agent
      agentInfo.setAgent(
        this.deseralizeAgent(packageFile, this.getClass().getClassLoader()));
       
      // set security-policy
      SecurityPolicyManager.getInstance().assignSecurityPolicy(agentInfo);
     
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

     * @return value at the given row/column.
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int row, int col)
    {
      AgentInfo info = this.agentInfos[row];

      switch (col)
      {
        case 0 :
          return info.getAgentName();
        case 1 :
          return new Integer(info.getAgentState());
        default :
          return null;
      }
    }
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

   */
  protected int deliverAgent(byte[] data, Node from)
  {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null)
    {
      return SimpleP2P.REPLY_ERROR;
    }


    // update AgentInfo
    info.setNodeReceivedFrom(from);
    info.setAgentName(info.getAgent().getName());
    info.setPackager(p);

    // put to run
    try
    {
      Container c = ContainerManager.getInstance().getContainer();
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

      }
    });

    container.setNodeName("TESTHOST");
    container.start();
    AgentInfo agentInfo = container.createAgentInfo();
    agentInfo.setPackager(new NullPackager());
    agentInfo.setAgentName("TestAgent");
    agentInfo.setSecurityPolicy(new EverythingAllowedPolicy());
    agentInfo.setAgent(new AgentBase(agentInfo.getAgentName())
    {

      public void start(AgentServices as)
      {
        System.out.println(new Date().toString());
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

     * @return value at the given row/column.
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int row, int col)
    {
      AgentInfo info = this.agentInfos[row];

      switch (col)
      {
        case 0 :
          return info.getAgentName();
        case 1 :
          return new Integer(info.getAgentState());
        default :
          return null;
      }
    }
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

  public AgentInfo unpackageAgent(byte[] packageFile)
  {
    try
    {
      // get AgentInfo
      AgentInfo agentInfo =
        ContainerManager.getInstance().getContainer().createAgentInfo();

      // deserialize Agent
      agentInfo.setAgent(
        this.deseralizeAgent(packageFile, this.getClass().getClassLoader()));
       
      // set security-policy
      SecurityPolicyManager.getInstance().assignSecurityPolicy(agentInfo);
     
View Full Code Here

Examples of de.tuclausthal.informatik.winf.mobileagents.container.AgentInfo

   * @see #REPLY_OK
   */
  protected int deliverAgent(byte[] data, Node from) {
    // unpackage
    Packager p = PackagingManager.getInstance().getPackager("StateOnly");
    AgentInfo info = p.unpackageAgent(data);
    if (info == null) {
      return this.REPLY_ERROR;
    }

    // update AgentInfo
    info.setNodeReceivedFrom(from);
    info.setAgentName(info.getAgent().getName());
    info.setPackager(p);

    // put to run
    try {
      Container c = ContainerManager.getInstance().getContainer();

View Full Code Here

Examples of org.jivesoftware.smackx.workgroup.packet.AgentInfo

     * Return the agents name.
     *
     * @return - the agents name.
     */
    public String getName() throws XMPPException {
        AgentInfo agentInfo = new AgentInfo();
        agentInfo.setType(IQ.Type.GET);
        agentInfo.setTo(workgroupJID);
        agentInfo.setFrom(getUser());
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID()));
        // Send the request
        connection.sendPacket(agentInfo);

        AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }
        return response.getName();
    }
View Full Code Here

Examples of org.jivesoftware.smackx.workgroup.packet.AgentInfo

     * @param newName the new name of the agent.
     * @throws XMPPException if the agent is not allowed to change his name or no response was
     *                       obtained from the server.
     */
    public void setName(String newName) throws XMPPException {
        AgentInfo agentInfo = new AgentInfo();
        agentInfo.setType(IQ.Type.SET);
        agentInfo.setTo(workgroupJID);
        agentInfo.setFrom(getUser());
        agentInfo.setName(newName);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID()));
        // Send the request
        connection.sendPacket(agentInfo);

        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

View Full Code Here

Examples of org.jivesoftware.smackx.workgroup.packet.AgentInfo

     * Return the agents name.
     *
     * @return - the agents name.
     */
    public String getName() throws XMPPException {
        AgentInfo agentInfo = new AgentInfo();
        agentInfo.setType(IQ.Type.GET);
        agentInfo.setTo(workgroupJID);
        agentInfo.setFrom(getUser());
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID()));
        // Send the request
        connection.sendPacket(agentInfo);

        AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }
        return response.getName();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.