Search in sources :

Example 1 with UninterpretedAttribute

use of dev.hawala.xns.level4.filing.fs.UninterpretedAttribute in project dodo by devhawala.

the class FileEntryTests method testFeAttributes.

@Test
public void testFeAttributes() {
    FileEntry fe = new FileEntry(2033, 255, true, "test complex FileEntry", 1, 0, "complex:dev:hawala");
    fe.setAccessListDefaulted(false);
    fe.getAccessList().add(new AccessEntry("user1:dev:hawala", FsConstants.fullAccess));
    fe.getAccessList().add(new AccessEntry("*:sys:tu-berlin", FsConstants.readAccess));
    fe.setDefaultAccessListDefaulted(false);
    fe.getDefaultAccessList().add(new AccessEntry("user2:dev:hawala", FsConstants.readAccess | FsConstants.writeAccess));
    fe.getDefaultAccessList().add(new AccessEntry("userX:zrz:tu-berlin", FsConstants.ownerAccess));
    fe.getUninterpretedAttributes().add(new UninterpretedAttribute(4433).add(0xFFFF).add(0).add(0x1234));
    fe.getUninterpretedAttributes().add(new UninterpretedAttribute(1122).add(0).add(0x4321).add(0xFFFF).add(0xFFFF));
    fe.setType(FsConstants.tDirectory);
    fe.setChecksum(0xFEDC);
    fe.setDataSize(4567);
    fe.setReadBy("user1:dev:hawala");
    fe.setReadOn(0x4255);
    fe.setModifiedBy("userX:zrz:tu-berlin");
    fe.setModifiedOn(0x4242);
    fe.setChildrenUniquelyNamed(false);
    // createdOn
    fe.setOrderingKey(3);
    fe.setOrderingAscending(false);
    fe.setOrderingInterpretation(FsConstants.intrTime);
    System.out.println();
    System.out.println(fe.toString());
    FileEntry result = outIn(fe);
    System.out.println(result.toString());
    assertEquals("fe -> outIn() -> result", fe.toString(), result.toString());
}
Also used : AccessEntry(dev.hawala.xns.level4.filing.fs.AccessEntry) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) Test(org.junit.Test)

Example 2 with UninterpretedAttribute

use of dev.hawala.xns.level4.filing.fs.UninterpretedAttribute in project dodo by devhawala.

the class MailService method postMail.

/**
 * Create a new mail posted to one or more recipients.
 *
 * @param sender the user sending the mail
 * @param recipients list of already verified recipients of the mail, having
 * 		groups (aka distribution-lists) already expanded
 * @param contentsType the type id for the mail content
 * @param source the filing source for the mail content
 * @return the mail identification for the created mail
 */
public int[] postMail(ThreePartName sender, NameList recipients, long contentsType, iContentSource source) {
    try (Session fSession = this.mailsVolume.startModificationSession()) {
        // get the next free mail-id
        int[] mailId = this.allocateMailId(fSession);
        String mailFileName = String.format("%08X-%04X-%04X", System.currentTimeMillis(), mailId[3], mailId[4]);
        // create the meta-data for the mail content file
        MailMetaData postedMetaData = new MailMetaData();
        postedMetaData.sender.from(sender);
        for (int i = 0; i < recipients.size(); i++) {
            postedMetaData.recipients.add(recipients.get(i));
        }
        postedMetaData.contentsType.set(contentsType);
        postedMetaData.mailboxReferences.set(recipients.size());
        UninterpretedAttribute postedMetaDataAttr = new UninterpretedAttribute(atPostedMetaData);
        postedMetaData.to(postedMetaDataAttr);
        // create the mail content file
        FileEntry mailFile = fSession.createFile(// . parentId
        mailfilesFolder.getFileID(), // ....................... isDirectory
        false, // ................ name
        mailFileName, // ........................... version
        1, // .................. type
        ftMailFile, // ......... creatingUser
        this.serviceNameFqn, Arrays.asList(fe -> fe.getUninterpretedAttributes().add(postedMetaDataAttr)), source);
        // create the envelope
        EncodedList env = EncodedList.make();
        env.add(Attribute.make().set(MailingCommon.atMtPostmark, Postmark::make, a -> {
            a.server.from(this.chsDatabase.getMailServiceFqn());
            a.time.fromUnixMillisecs(System.currentTimeMillis());
        }));
        env.add(Attribute.make().set(MailingCommon.atMtMessageID, MessageID::make, a -> {
            for (int i = 0; i < mailId.length; i++) {
                a.get(i).set(mailId[i]);
            }
        }));
        env.add(Attribute.make().setAsLongCardinal(MailingCommon.atMtContentsType, contentsType));
        env.add(Attribute.make().setAsLongCardinal(MailingCommon.atMtContentsSize, mailFile.getDataSize()));
        env.add(Attribute.make().setAsChsName(MailingCommon.atMtOriginator, sender));
        env.add(Attribute.make().setAsChsName(MailingCommon.atMtReturnToName, sender));
        ValueContentSource envelopeSource = new ValueContentSource(env);
        // create the inbox-references in the mailboxes of all recipients
        String inboxMailFileName = mailFileName + INBOX_SUFFIX_NEW;
        for (int i = 0; i < recipients.size(); i++) {
            Name rcpt = recipients.get(i);
            FileEntry mailbox = this.mailboxes.get(rcpt.getLcFqn());
            // should never happen...
            if (mailbox == null) {
                continue;
            }
            fSession.createFile(// ......... parentId
            mailbox.getFileID(), // ....................... isDirectory
            false, // ........... name
            inboxMailFileName, // ........................... version
            1, // ................. type
            ftInboxMail, // ......... creatingUser
            this.serviceNameFqn, Collections.emptyList(), envelopeSource.reset());
        }
        // done
        return mailId;
    } catch (IllegalStateException e) {
        Log.C.printf("MS", "postMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        new ServiceErrorRecord(ServiceProblem.serviceUnavailable).raise();
    } catch (InterruptedException e) {
        Log.C.printf("MS", "postMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        new ServiceErrorRecord(ServiceProblem.serviceUnavailable).raise();
    } catch (Exception e) {
        Log.C.printf("MS", "postMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        new ServiceErrorRecord(ServiceProblem.serviceUnavailable).raise();
    }
    // keep the compiler happy (errors raised do not return)
    return null;
}
Also used : NameList(dev.hawala.xns.level4.mailing.MailingCommon.NameList) Arrays(java.util.Arrays) Random(java.util.Random) TransferProblem(dev.hawala.xns.level4.mailing.MailingCommon.TransferProblem) EncodedList(dev.hawala.xns.level4.mailing.MailingCommon.EncodedList) WirePacketReader(dev.hawala.xns.level3.courier.WirePacketReader) Map(java.util.Map) ServiceProblem(dev.hawala.xns.level4.mailing.MailingCommon.ServiceProblem) WireSeqOfUnspecifiedReader(dev.hawala.xns.level3.courier.WireSeqOfUnspecifiedReader) Credentials(dev.hawala.xns.level4.common.AuthChsCommon.Credentials) ErrorRECORD(dev.hawala.xns.level3.courier.ErrorRECORD) Attribute(dev.hawala.xns.level4.filing.FilingCommon.Attribute) ListElementRecord(dev.hawala.xns.level4.mailing.MailingCommon.ListElementRecord) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) Log(dev.hawala.xns.Log) AuthenticationProblem(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationProblem) dev.hawala.xns.level3.courier.iWireData(dev.hawala.xns.level3.courier.iWireData) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) List(java.util.List) CredentialsType(dev.hawala.xns.level4.common.AuthChsCommon.CredentialsType) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) ChsDatabase(dev.hawala.xns.level4.common.ChsDatabase) NetworkAddress(dev.hawala.xns.level4.common.AuthChsCommon.NetworkAddress) RECORD(dev.hawala.xns.level3.courier.RECORD) ServiceErrorRecord(dev.hawala.xns.level4.mailing.MailTransport4.ServiceErrorRecord) dev.hawala.xns.level4.filing.fs.iContentSource(dev.hawala.xns.level4.filing.fs.iContentSource) ByteArrayOutputStream(java.io.ByteArrayOutputStream) dev.hawala.xns.level3.courier.iWireStream(dev.hawala.xns.level3.courier.iWireStream) StrongVerifier(dev.hawala.xns.level4.common.AuthChsCommon.StrongVerifier) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) AuthenticationErrorRecord(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationErrorRecord) HashMap(java.util.HashMap) Session(dev.hawala.xns.level4.filing.fs.Volume.Session) ByteContentSink(dev.hawala.xns.level4.filing.ByteContentSink) dev.hawala.xns.level3.courier.iWireDynamic(dev.hawala.xns.level3.courier.iWireDynamic) ArrayList(java.util.ArrayList) WireBaseStream(dev.hawala.xns.level3.courier.WireBaseStream) Volume(dev.hawala.xns.level4.filing.fs.Volume) dev.hawala.xns.level4.filing.fs.iContentSink(dev.hawala.xns.level4.filing.fs.iContentSink) Name(dev.hawala.xns.level4.common.AuthChsCommon.Name) MailHeaderData(dev.hawala.xns.level4.mailing.MailingCommon.MailHeaderData) WireWriter(dev.hawala.xns.level3.courier.WireWriter) CARDINAL(dev.hawala.xns.level3.courier.CARDINAL) LONG_CARDINAL(dev.hawala.xns.level3.courier.LONG_CARDINAL) AuthChsCommon(dev.hawala.xns.level4.common.AuthChsCommon) Verifier(dev.hawala.xns.level4.common.AuthChsCommon.Verifier) CHEntries0(dev.hawala.xns.level4.chs.CHEntries0) IOException(java.io.IOException) MessageID(dev.hawala.xns.level4.mailing.MailingCommon.MessageID) Postmark(dev.hawala.xns.level4.mailing.MailingCommon.Postmark) ThreePartName(dev.hawala.xns.level4.common.AuthChsCommon.ThreePartName) TransferErrorRecord(dev.hawala.xns.level4.mailing.Inbasket1.TransferErrorRecord) Collections(java.util.Collections) State(dev.hawala.xns.level4.mailing.Inbasket1.State) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) ServiceErrorRecord(dev.hawala.xns.level4.mailing.MailTransport4.ServiceErrorRecord) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) IOException(java.io.IOException) Name(dev.hawala.xns.level4.common.AuthChsCommon.Name) ThreePartName(dev.hawala.xns.level4.common.AuthChsCommon.ThreePartName) EncodedList(dev.hawala.xns.level4.mailing.MailingCommon.EncodedList) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) Session(dev.hawala.xns.level4.filing.fs.Volume.Session)

Example 3 with UninterpretedAttribute

use of dev.hawala.xns.level4.filing.fs.UninterpretedAttribute in project dodo by devhawala.

the class MailService method dropMail.

/**
 * Delete the given mail in the given mail session.
 *
 * @param session the mail session for the mailbox where the mail is located
 * @param mail the mail to be deleted
 * @return {@code null} if deleting the mail in the mailbox was successful,
 * 		otherwise the Courier error holding the problem to report to the client
 */
public synchronized ErrorRECORD dropMail(MailSession session, MailboxEntry mail) {
    /*
		 * 1. in all other sessions for the same mailbox: .resetInboxEntry() for the same postboxId
		 * 2. delete the mailbox-file in this session
		 * 3. possibly delete the contentFile if the last mailbox-file referencing it was deleted
		 */
    // check if this mailbox-entry was already deleted (possibly in a different session)
    FileEntry mailFile = mail.inboxEntry();
    if (mailFile == null) {
        // already deleted, not an error
        return null;
    }
    // in all other sessions for the same mailbox: .resetInboxEntry() for the same postboxId
    String mailboxName = session.getUserLcFqn();
    String mailId = mail.postboxId();
    for (MailSession candidate : this.activeSessions.values()) {
        if (candidate == session) {
            continue;
        }
        if (candidate.getUserLcFqn().equals(mailboxName)) {
            continue;
        }
        for (int i = 0; i < candidate.getMailCount(); i++) {
            MailboxEntry me = candidate.getMailEntry(i);
            if (me.isMail(mailId)) {
                me.resetInboxEntry();
                continue;
            }
        }
    }
    // delete the file and possibly the contentFile
    List<FileEntry> contentFiles = this.mailsVolume.findFiles(this.mailfilesFolder.getFileID(), f -> mailId.equalsIgnoreCase(f.getName()), // maxCount,
    1, // maxDepth,
    1, this.serviceNameFqn);
    if (contentFiles.size() != 1) {
        // there is nothing appropriate...
        return new ServiceErrorRecord(ServiceProblem.serviceUnavailable);
    }
    FileEntry contentFile = contentFiles.get(0);
    // get the meta-data for the mail content file
    UninterpretedAttribute postedMetaDataAttr = contentFile.getUninterpretedAttribute(atPostedMetaData);
    MailMetaData postedMetaData = MetaData.from(postedMetaDataAttr, MailMetaData::make);
    // check if the posted mail has also to be deleted
    int refCount = postedMetaData.mailboxReferences.get() - 1;
    boolean deletePostedMail = (refCount < 1);
    // drop resp. modify the file(s)
    try (Session fSession = this.mailsVolume.startModificationSession()) {
        if (deletePostedMail) {
            fSession.deleteFile(contentFile, this.serviceNameFqn);
        } else {
            postedMetaData.mailboxReferences.set(refCount);
            postedMetaData.to(postedMetaDataAttr);
            fSession.updateFileAttributes(contentFile, Arrays.asList(fe -> {
            }), this.serviceNameFqn);
        }
        fSession.deleteFile(mailFile, this.serviceNameFqn);
    } catch (IllegalStateException e) {
        Log.C.printf("MS", "dropMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        return new ServiceErrorRecord(ServiceProblem.serviceUnavailable);
    } catch (InterruptedException e) {
        Log.C.printf("MS", "dropMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        return new ServiceErrorRecord(ServiceProblem.serviceUnavailable);
    } catch (Exception e) {
        Log.C.printf("MS", "dropMail() -> rejecting with ServiceError[serviceUnavailable], cause: %s\n", e.getMessage());
        return new ServiceErrorRecord(ServiceProblem.serviceUnavailable);
    }
    // successful
    return null;
}
Also used : NameList(dev.hawala.xns.level4.mailing.MailingCommon.NameList) Arrays(java.util.Arrays) Random(java.util.Random) TransferProblem(dev.hawala.xns.level4.mailing.MailingCommon.TransferProblem) EncodedList(dev.hawala.xns.level4.mailing.MailingCommon.EncodedList) WirePacketReader(dev.hawala.xns.level3.courier.WirePacketReader) Map(java.util.Map) ServiceProblem(dev.hawala.xns.level4.mailing.MailingCommon.ServiceProblem) WireSeqOfUnspecifiedReader(dev.hawala.xns.level3.courier.WireSeqOfUnspecifiedReader) Credentials(dev.hawala.xns.level4.common.AuthChsCommon.Credentials) ErrorRECORD(dev.hawala.xns.level3.courier.ErrorRECORD) Attribute(dev.hawala.xns.level4.filing.FilingCommon.Attribute) ListElementRecord(dev.hawala.xns.level4.mailing.MailingCommon.ListElementRecord) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) Log(dev.hawala.xns.Log) AuthenticationProblem(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationProblem) dev.hawala.xns.level3.courier.iWireData(dev.hawala.xns.level3.courier.iWireData) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) List(java.util.List) CredentialsType(dev.hawala.xns.level4.common.AuthChsCommon.CredentialsType) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) ChsDatabase(dev.hawala.xns.level4.common.ChsDatabase) NetworkAddress(dev.hawala.xns.level4.common.AuthChsCommon.NetworkAddress) RECORD(dev.hawala.xns.level3.courier.RECORD) ServiceErrorRecord(dev.hawala.xns.level4.mailing.MailTransport4.ServiceErrorRecord) dev.hawala.xns.level4.filing.fs.iContentSource(dev.hawala.xns.level4.filing.fs.iContentSource) ByteArrayOutputStream(java.io.ByteArrayOutputStream) dev.hawala.xns.level3.courier.iWireStream(dev.hawala.xns.level3.courier.iWireStream) StrongVerifier(dev.hawala.xns.level4.common.AuthChsCommon.StrongVerifier) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) AuthenticationErrorRecord(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationErrorRecord) HashMap(java.util.HashMap) Session(dev.hawala.xns.level4.filing.fs.Volume.Session) ByteContentSink(dev.hawala.xns.level4.filing.ByteContentSink) dev.hawala.xns.level3.courier.iWireDynamic(dev.hawala.xns.level3.courier.iWireDynamic) ArrayList(java.util.ArrayList) WireBaseStream(dev.hawala.xns.level3.courier.WireBaseStream) Volume(dev.hawala.xns.level4.filing.fs.Volume) dev.hawala.xns.level4.filing.fs.iContentSink(dev.hawala.xns.level4.filing.fs.iContentSink) Name(dev.hawala.xns.level4.common.AuthChsCommon.Name) MailHeaderData(dev.hawala.xns.level4.mailing.MailingCommon.MailHeaderData) WireWriter(dev.hawala.xns.level3.courier.WireWriter) CARDINAL(dev.hawala.xns.level3.courier.CARDINAL) LONG_CARDINAL(dev.hawala.xns.level3.courier.LONG_CARDINAL) AuthChsCommon(dev.hawala.xns.level4.common.AuthChsCommon) Verifier(dev.hawala.xns.level4.common.AuthChsCommon.Verifier) CHEntries0(dev.hawala.xns.level4.chs.CHEntries0) IOException(java.io.IOException) MessageID(dev.hawala.xns.level4.mailing.MailingCommon.MessageID) Postmark(dev.hawala.xns.level4.mailing.MailingCommon.Postmark) ThreePartName(dev.hawala.xns.level4.common.AuthChsCommon.ThreePartName) TransferErrorRecord(dev.hawala.xns.level4.mailing.Inbasket1.TransferErrorRecord) Collections(java.util.Collections) State(dev.hawala.xns.level4.mailing.Inbasket1.State) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) ServiceErrorRecord(dev.hawala.xns.level4.mailing.MailTransport4.ServiceErrorRecord) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) IOException(java.io.IOException) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) Session(dev.hawala.xns.level4.filing.fs.Volume.Session)

Example 4 with UninterpretedAttribute

use of dev.hawala.xns.level4.filing.fs.UninterpretedAttribute in project dodo by devhawala.

the class MailService method allocateMailId.

/**
 * Allocate a new mail-id for this mail-service by updating
 * the file attribute on the mailfiles folder, where the
 * last mail-id is persisted.
 *
 * @param session the Filing(!) session for saving the newly allocated id
 * @return the 5 words holding the new file-id
 */
private int[] allocateMailId(Session session) {
    // get the last mail-id
    UninterpretedAttribute attr = this.mailfilesFolder.getUninterpretedAttribute(atLastMailId);
    if (attr == null) {
        throw new IllegalStateException("unable to allocate new mail-id: (null last-mail-id attribute)");
    }
    int[] mailId = new int[] { attr.get(0) & 0xFFFF, attr.get(1) & 0xFFFF, attr.get(2) & 0xFFFF, attr.get(3) & 0xFFFF, attr.get(4) & 0xFFFF };
    // increment the running counter
    long newId = ((mailId[3] << 16) | mailId[4]) + 1;
    mailId[3] = (int) ((newId >> 16) & 0xFFFFL);
    mailId[4] = (int) (newId & 0xFFFFL);
    // update the mailfiles folder
    try {
        session.updateFileAttributes(this.mailfilesFolder, Arrays.asList(fe -> {
            attr.clear().add(mailId[0]).add(mailId[1]).add(mailId[2]).add(mailId[3]).add(mailId[4]);
        }), this.serviceNameFqn);
    } catch (Exception e) {
        throw new IllegalStateException("unable to allocate new mail-id: " + e.getMessage());
    }
    // done
    return mailId;
}
Also used : NameList(dev.hawala.xns.level4.mailing.MailingCommon.NameList) Arrays(java.util.Arrays) Random(java.util.Random) TransferProblem(dev.hawala.xns.level4.mailing.MailingCommon.TransferProblem) EncodedList(dev.hawala.xns.level4.mailing.MailingCommon.EncodedList) WirePacketReader(dev.hawala.xns.level3.courier.WirePacketReader) Map(java.util.Map) ServiceProblem(dev.hawala.xns.level4.mailing.MailingCommon.ServiceProblem) WireSeqOfUnspecifiedReader(dev.hawala.xns.level3.courier.WireSeqOfUnspecifiedReader) Credentials(dev.hawala.xns.level4.common.AuthChsCommon.Credentials) ErrorRECORD(dev.hawala.xns.level3.courier.ErrorRECORD) Attribute(dev.hawala.xns.level4.filing.FilingCommon.Attribute) ListElementRecord(dev.hawala.xns.level4.mailing.MailingCommon.ListElementRecord) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) Log(dev.hawala.xns.Log) AuthenticationProblem(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationProblem) dev.hawala.xns.level3.courier.iWireData(dev.hawala.xns.level3.courier.iWireData) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) List(java.util.List) CredentialsType(dev.hawala.xns.level4.common.AuthChsCommon.CredentialsType) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) ChsDatabase(dev.hawala.xns.level4.common.ChsDatabase) NetworkAddress(dev.hawala.xns.level4.common.AuthChsCommon.NetworkAddress) RECORD(dev.hawala.xns.level3.courier.RECORD) ServiceErrorRecord(dev.hawala.xns.level4.mailing.MailTransport4.ServiceErrorRecord) dev.hawala.xns.level4.filing.fs.iContentSource(dev.hawala.xns.level4.filing.fs.iContentSource) ByteArrayOutputStream(java.io.ByteArrayOutputStream) dev.hawala.xns.level3.courier.iWireStream(dev.hawala.xns.level3.courier.iWireStream) StrongVerifier(dev.hawala.xns.level4.common.AuthChsCommon.StrongVerifier) FileEntry(dev.hawala.xns.level4.filing.fs.FileEntry) AuthenticationErrorRecord(dev.hawala.xns.level4.mailing.MailingCommon.AuthenticationErrorRecord) HashMap(java.util.HashMap) Session(dev.hawala.xns.level4.filing.fs.Volume.Session) ByteContentSink(dev.hawala.xns.level4.filing.ByteContentSink) dev.hawala.xns.level3.courier.iWireDynamic(dev.hawala.xns.level3.courier.iWireDynamic) ArrayList(java.util.ArrayList) WireBaseStream(dev.hawala.xns.level3.courier.WireBaseStream) Volume(dev.hawala.xns.level4.filing.fs.Volume) dev.hawala.xns.level4.filing.fs.iContentSink(dev.hawala.xns.level4.filing.fs.iContentSink) Name(dev.hawala.xns.level4.common.AuthChsCommon.Name) MailHeaderData(dev.hawala.xns.level4.mailing.MailingCommon.MailHeaderData) WireWriter(dev.hawala.xns.level3.courier.WireWriter) CARDINAL(dev.hawala.xns.level3.courier.CARDINAL) LONG_CARDINAL(dev.hawala.xns.level3.courier.LONG_CARDINAL) AuthChsCommon(dev.hawala.xns.level4.common.AuthChsCommon) Verifier(dev.hawala.xns.level4.common.AuthChsCommon.Verifier) CHEntries0(dev.hawala.xns.level4.chs.CHEntries0) IOException(java.io.IOException) MessageID(dev.hawala.xns.level4.mailing.MailingCommon.MessageID) Postmark(dev.hawala.xns.level4.mailing.MailingCommon.Postmark) ThreePartName(dev.hawala.xns.level4.common.AuthChsCommon.ThreePartName) TransferErrorRecord(dev.hawala.xns.level4.mailing.Inbasket1.TransferErrorRecord) Collections(java.util.Collections) State(dev.hawala.xns.level4.mailing.Inbasket1.State) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) NoMoreWriteSpaceException(dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException) EndOfMessageException(dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException) IOException(java.io.IOException)

Example 5 with UninterpretedAttribute

use of dev.hawala.xns.level4.filing.fs.UninterpretedAttribute in project dodo by devhawala.

the class AttributeUtils method file2courier_uninterpreted.

public static void file2courier_uninterpreted(AttributeSequence s, long atCode, FileEntry fe) {
    UninterpretedAttribute a = fe.getUninterpretedAttribute(atCode);
    Attribute attr = s.value.add();
    attr.type.set(atCode);
    if (a == null) {
        return;
    }
    for (int i = 0; i < a.size(); i++) {
        attr.value.add().set(a.get(i));
    }
}
Also used : FilterAttribute(dev.hawala.xns.level4.filing.FilingCommon.FilterAttribute) Attribute(dev.hawala.xns.level4.filing.FilingCommon.Attribute) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute) UninterpretedAttribute(dev.hawala.xns.level4.filing.fs.UninterpretedAttribute)

Aggregations

UninterpretedAttribute (dev.hawala.xns.level4.filing.fs.UninterpretedAttribute)5 Attribute (dev.hawala.xns.level4.filing.FilingCommon.Attribute)4 FileEntry (dev.hawala.xns.level4.filing.fs.FileEntry)4 Log (dev.hawala.xns.Log)3 CARDINAL (dev.hawala.xns.level3.courier.CARDINAL)3 ErrorRECORD (dev.hawala.xns.level3.courier.ErrorRECORD)3 LONG_CARDINAL (dev.hawala.xns.level3.courier.LONG_CARDINAL)3 RECORD (dev.hawala.xns.level3.courier.RECORD)3 WireBaseStream (dev.hawala.xns.level3.courier.WireBaseStream)3 WirePacketReader (dev.hawala.xns.level3.courier.WirePacketReader)3 WireSeqOfUnspecifiedReader (dev.hawala.xns.level3.courier.WireSeqOfUnspecifiedReader)3 WireWriter (dev.hawala.xns.level3.courier.WireWriter)3 dev.hawala.xns.level3.courier.iWireData (dev.hawala.xns.level3.courier.iWireData)3 dev.hawala.xns.level3.courier.iWireDynamic (dev.hawala.xns.level3.courier.iWireDynamic)3 dev.hawala.xns.level3.courier.iWireStream (dev.hawala.xns.level3.courier.iWireStream)3 EndOfMessageException (dev.hawala.xns.level3.courier.iWireStream.EndOfMessageException)3 NoMoreWriteSpaceException (dev.hawala.xns.level3.courier.iWireStream.NoMoreWriteSpaceException)3 CHEntries0 (dev.hawala.xns.level4.chs.CHEntries0)3 AuthChsCommon (dev.hawala.xns.level4.common.AuthChsCommon)3 Credentials (dev.hawala.xns.level4.common.AuthChsCommon.Credentials)3