Search in sources :

Example 11 with ChsDatabase

use of dev.hawala.xns.level4.common.ChsDatabase in project dodo by devhawala.

the class TestChsDatabase method main.

public static void main(String[] args) {
    ChsDatabase chsdb = new ChsDatabase(1033, "org.o", "dom.d", "./chs-database", true);
    chsdb.dump();
}
Also used : ChsDatabase(dev.hawala.xns.level4.common.ChsDatabase)

Example 12 with ChsDatabase

use of dev.hawala.xns.level4.common.ChsDatabase in project dodo by devhawala.

the class DodoTest method testBfsChsService.

private static void testBfsChsService() throws XnsException {
    ChsDatabase chsDatabase = new ChsDatabase(0x1122_3344, "organization", "domain", null, true);
    Clearinghouse3Impl.init(0x1122_3344, 0xAABB_CCDD_EEFFL, chsDatabase);
    localSite.pexListen(IDP.KnownSocket.CLEARINGHOUSE.getSocket(), new BfsClearinghouseResponder());
    byte[] requestData = { 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x56, 0x78, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00 };
    Payload response = localSite.pexRequest(IDP.BROADCAST_ADDR, IDP.KnownSocket.CLEARINGHOUSE.getSocket(), PEX.ClientType.CLEARINGHOUSE.getTypeValue(), requestData, 0, requestData.length);
    if (response == null) {
        System.out.println("bfs response: null (timeout)\n");
    } else if (response instanceof PEX) {
        System.out.println("bfs response is of type: PEX\n");
        PEX pex = (PEX) response;
        System.out.printf("=> PEX: %s\n", pex.toString());
        System.out.printf("=> PEX.payload: %s\n", pex.payloadToString());
    } else if (response instanceof Error) {
        System.out.println("bfs response is of type: Error\n");
    } else {
        System.out.printf("bfs response is of unexpected type: %s\n", response.getClass().getName());
    }
}
Also used : PEX(dev.hawala.xns.level2.PEX) BfsClearinghouseResponder(dev.hawala.xns.level4.chs.BfsClearinghouseResponder) Error(dev.hawala.xns.level2.Error) Payload(dev.hawala.xns.level0.Payload) ChsDatabase(dev.hawala.xns.level4.common.ChsDatabase)

Aggregations

EndOfMessageException (dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException)5 ChsDatabase (dev.hawala.xns.level4.common.ChsDatabase)5 ThreePartName (dev.hawala.xns.level4.common.AuthChsCommon.ThreePartName)4 NoMoreWriteSpaceException (dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException)3 BfsClearinghouseResponder (dev.hawala.xns.level4.chs.BfsClearinghouseResponder)2 Name (dev.hawala.xns.level4.common.AuthChsCommon.Name)2 NetworkAddress (dev.hawala.xns.level4.common.AuthChsCommon.NetworkAddress)2 Volume (dev.hawala.xns.level4.filing.fs.Volume)2 NameList (dev.hawala.xns.level4.mailing.MailingCommon.NameList)2 File (java.io.File)2 IOException (java.io.IOException)2 Payload (dev.hawala.xns.level0.Payload)1 Error (dev.hawala.xns.level2.Error)1 PEX (dev.hawala.xns.level2.PEX)1 CourierServer (dev.hawala.xns.level3.courier.CourierServer)1 STRING (dev.hawala.xns.level3.courier.STRING)1 CourierException (dev.hawala.xns.level3.courier.exception.CourierException)1 BfsAuthenticationResponder (dev.hawala.xns.level4.auth.BfsAuthenticationResponder)1 BootResponder (dev.hawala.xns.level4.boot.BootResponder)1 AuthenticationErrorRecord (dev.hawala.xns.level4.chs.Clearinghouse3.AuthenticationErrorRecord)1