All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.micro.helpline.HelplineService Maven / Gradle / Ivy

The newest version!
package jadex.micro.helpline;

import jadex.future.IIntermediateFuture;
import jadex.future.IntermediateFuture;
import jadex.providedservice.annotation.Service;
import jadex.providedservice.annotation.ServiceComponent;

/**
 *  Helpline service implementation.
 */
@Service
public class HelplineService implements IHelpline
{
	//-------- attributes --------
	
	/** The agent. */
	@ServiceComponent
	protected HelplineAgent agent;
	
	//-------- methods --------
	
	/**
	 *  Add an information about a person.
	 *  @param name The person's name.
	 *  @param info The information.
	 */
	public void addInformation(final String name, final String info)
	{
		agent.addInformation(name, info);
	}
	
	/**
	 *  Get all locally stored information about a person.
	 *  @param name The person's name.
	 *  @return Future that contains the information.
	 */
	public IIntermediateFuture getInformation(final String name)
	{
		return new IntermediateFuture(agent.getInformation(name));
	}

	/**
	 *  Get the string representation.
	 *  @return The string representation.
	 */
	public String toString()
	{
		return "HelplineService, "+agent.getAgent().getId();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy