root/src/java/src/com/omniti/reconnoiter/event/NoitEvent.java

Revision e8b241b833cdda315cc463b322a89ba888c5e781, 1.1 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 years ago)

juggle files around for cleaner builds.

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2009, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  * The software in this package is published under the terms of the GPL license
5  * a copy of which can be found at:
6  * https://labs.omniti.com/reconnoiter/trunk/src/java/LICENSE
7  */
8
9 package com.omniti.reconnoiter.event;
10
11 import com.omniti.reconnoiter.IEventHandler;
12 import com.omniti.reconnoiter.StratconMessage;
13
14 public abstract class NoitEvent extends StratconMessage {
15   public NoitEvent() {}
16   public NoitEvent(String[] parts) throws Exception {
17     super(parts);
18   }
19   public String[] extended_id_split(String id) {
20     String parts[] = { null, null, null, null }; /* target,module,name,uuid */
21     if(id.length() <= 36) {
22       parts[3] = id;
23       return parts;
24     }
25     parts[3] = id.substring(id.length() - 36);
26     int p1 = id.indexOf('`');
27     if(p1 < 0) return parts;
28     parts[0] = id.substring(0,p1);
29     int p2 = id.indexOf('`', p1+1);
30     if(p2 < 0) return parts;
31     parts[1] = id.substring(p1+1,p2);
32     parts[2] = id.substring(p2+1,id.length()-37);
33     return parts;
34   }
35   public void handle(IEventHandler eh) {
36     eh.sendEvent(this);
37   }
38 }
Note: See TracBrowser for help on using the browser.