DBagents dbagents@scch.at +43 7236 3343 837 www.scch.at Mobile Agents for Database Applications Ludwig Klug Database Agents 1 Ludwig Klug ■ Ludwig works with Agents for more than 1.5 years ■ Technical consultant for Grasshopper implementations ■ Implementation of DBagents Database Agents 2 1
DBagents dbagents@scch.at +43 7236 3343 837 www.scch.at Grasshopper Building an Agent with Grasshopper Database Agents 3 Grasshopper – The Agent Platform ■ Producer � IKV++ GmbH, Berlin, Germany � Partner of GMD FOKUS ■ Costs � Evaluation free of charge � Licenses ~10000 € (for 100 VAR licenses) � 3000 € / Year for premium support (answers within 24 hrs) � Discussion forum (answers usually within 1 week) Database Agents 4 2
Grasshopper - The Agent Platform ■ FIPA and MASIF Extensions � One of few agent platforms building on standards � Extensions realized as Grasshopper agents Database Agents 5 Grasshopper Security I ■ External Security � Protect agents against external threats � SSL (e.g., IAIK Implementation) ■ Internal Security � Protect platforms against hostile agents � Protect agents against hostile platforms � Public key encryption (certificates) Database Agents 6 3
Grasshopper Security II ■ Authorization � Restrict Access to Agency Resources – Directories – Sockets � Policy Files (for Each Place Separate) – Current version only allows the same access rights for all agents – Next version: codesource-based access control ■ Missing: Protecting agents against hostile platforms Database Agents 7 Communication ■ Agent-to-Agent, Agent-to-Platform, Agent- to-Registry ■ Communication Over Proxies ■ Synchronous Communication � Wait for a return value ■ Asynchronous Communication � Do not wait for a return value ■ Broadcasts � Communicate with more object simultaneously Database Agents 8 4
Grasshopper Agent Model I ■ Region � Unit of agencies � Region registry maintains agent addresses ■ Agency � Container for places � Usually one agency on one computer Database Agents 9 Grasshopper Agent Model II ■ Place � Runtime environment for agents ■ Agent � Code that runs as a thread in a place � (Optional) can move between places Database Agents 10 5
Grasshopper Agent Model III ■ What is an agent? � Instance of subclass of MobileAgent or StationaryAgent � Has a unique identifier (IP-address, time, copy-number) Database Agents 11 Grasshopper Agent Model IV ■ MobileAgent � Allowed to move � PersistentMobileAgent ■ StationaryAgent � Limited to a single place � PersistentStationaryAgent Database Agents 12 6
Actions ■ public void init(Object[] args) � Initialization of the agent (agent parameters) � Called after the agent is loaded ■ public void live() � Heart of the agent (agent‘s active behaviour) � Only method that MUST be overridden Database Agents 13 Actions ■ public void move (GrasshopperAddress location) � Migrate to another location ■ public void remove() � Destroy an agent. Database Agents 14 7
Event Handlers ■ before/afterMove � Called before/after the agent migrates ■ before/afterCopy � Called before/after the agent is cloned ■ beforeRemove � Called before the agent is removed Database Agents 15 Example Agency Structure chicago.scch.at Linz InformationDesk Hauptplatz newyork.scch.at boston.scch.at Hagenberg Wien InformationDesk InformationDesk Softwarepark Stephansplatz Database Agents 16 8
Creating a Region Registry ■ Decide on Which Computer It Should Run � Registry is vital for agencies � Computer should run permanently Database Agents 17 Creating a Region Registry ■ Three Ways To (Configure and) Run an Agency � Commandline argument � Wizard � Profile editing ■ GUI/TUI option Database Agents 18 9
Creating the Agencies ■ Name of the Agency ■ Decide Which Region it Should Belong to ■ Access Control ■ Security ■ Enter Region Address � Format: socket://chicago:7020/Austria protocol://host:port/region Database Agents 19 Creating Places ■ Place InformationDesk is Predefined � Place where every agent can migrate to � No security limits Place creation in an agency Database Agents 20 10
Creating Places ■ Create Custom Places � Specify a name � Specify security policy Place creation in an agency Database Agents 21 3 Ways of Running an Agent ■ GUI � In an agency explorer by right-clicking and selecting "New Agent" on a place's popup menu ■ Profile � The user can define an agent in the configuration window, which is started on initialization of the agency Database Agents 22 11
3 Ways of Running an Agent ■ API � During execution of an agent another agent can be activated by calling the createAgent-method of the Grasshopper API Database Agents 23 Agent life cycle Database Agents 24 12
Agent@Singapore Agency Singapore Agency Singapore Agent Agent here here creator creator Singapore Singapore Singapore Singapore toVisitVector toVisitVector visitedVector visitedVector Singapore Singapore Singapore Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Chicago Chicago Chicago Moscow Moscow Moscow Agent.move(Tokyo) Database Agents 25 Agent@Tokyo Agency Singapore Agency Tokyo Agent Agent here here creator creator Singapore Tokyo Singapore Singapore toVisitVector visitedVector toVisitVector visitedVector Singapore Singapore Singapore Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Chicago Chicago Chicago Moscow Moscow Moscow Agent.move(Moscow) Database Agents 26 13
Agent@Moscow Agency Singapore Agency Moscow Agency Tokyo Agent Agent Agent here here here creator creator creator Singapore Moscow Tokyo Singapore Singapore Singapore toVisitVector toVisitVector toVisitVector visitedVector visitedVector visitedVector Singapore Singapore Singapore Singapore Tokyo Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Frankfurt Chicago Chicago Chicago Chicago Moscow Moscow Moscow Moscow Agent.move(Frankfurt) Database Agents 27 Agent@Frankfurt Agency Singapore Agency Frankfurt Agency Tokyo Agent Agent Agent here here creator creator here creator Singapore Frankfurt Tokyo Singapore Singapore Singapore toVisitVector visitedVector toVisitVector toVisitVector visitedVector visitedVector Singapore Singapore Singapore Singapore Tokyo Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Frankfurt Moscow Chicago Chicago Chicago Chicago Moscow Moscow Moscow Agent.move(Chicago) Database Agents 28 14
Agent@Chicago Agency Singapore Agency Chicago Agency Tokyo Agent Agent Agent here here here creator creator creator Singapore Chicago Tokyo Singapore Singapore Singapore toVisitVector toVisitVector toVisitVector visitedVector visitedVector visitedVector Singapore Singapore Singapore Singapore Tokyo Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Moscow Chicago Chicago Chicago Frankfurt Chicago Moscow Moscow Moscow Agent.move(Singapore) Database Agents 29 Agent@Singapore Agency Singapore Agency Singapore Agency Tokyo Agent Agent Agent here here creator creator here creator Singapore Singapore Tokyo Singapore Singapore Singapore toVisitVector visitedVector toVisitVector toVisitVector visitedVector visitedVector Singapore Singapore Singapore Singapore Tokyo Tokyo Tokyo Tokyo Frankfurt Frankfurt Frankfurt Moscow Chicago Chicago Frankfurt Chicago Moscow Moscow Moscow Chicago Database Agents 30 15
DBagents dbagents@scch.at +43 7236 3343 837 www.scch.at DBagents Agents in Database Systems Database Agents 31 DBagents ■ Basic platform runtime required on each computer Advantages ■ Database queries within DBMS ■ Searching within network ■ Load balancing (not between DB servers but processing at the DB where data is located) Database Agents 32 16
Solution Concept ■ Standard Agent Platform for Transportation � Extend available migration strategies � Extend available security solutions � Perform non-SQL operations (e.g., schema export) � Transport query results back to home agency Database Agents 33 Solution Concept ■ Mobile Database Agents � SQL statements � SQL scripts � Java stored procedures Database Agents 34 17
Implemented Architecture dbag on miami.scch.at miami.scch.at MediatorAgents Miami �������� �������� dbttest on boston.scch.at boston.scch.at ���� Boston newyork.scch.at NewYork ���� UIAgent Transport Agent DBagent RegionRegistry Database Agents 35 Implemented Architecture dbag on chicago.scch.at dbttest on havana.scch.at boston.scch.at miami.scch.at MediatorAgents Miami Boston ����� ����� newyork.scch.at ������ NewYork UIAgent ������ Transport Agent DBagent RegionRegistry Database Agents 36 18
DBagents Framework DBagents provides a flexible API to support agent-based operations for DBs. Database Agents 37 DBagents Framework ■ 4 Agent types ■ 4 Result handlers ■ 2 Communication modes ■ Agent groups support multi-agent transactions ■ UI templates for results, logs and migration strategies Database Agents 38 19
Recommend
More recommend