001package co.codewizards.cloudstore.core.dto;
002
003import java.util.UUID;
004
005import javax.xml.bind.annotation.XmlRootElement;
006
007import co.codewizards.cloudstore.core.util.Base64Url;
008
009/**
010 * Dto for {@code LocalRepository} and {@code RemoteRepository}.
011 * <p>
012 * <b>Important:</b> This object can be read anonymously without authentication! It therefore
013 * does currently not contain any sensitive information.
014 * <p>
015 * Future refactorings must take this into account and never add any secret data here! The world
016 * can read it! See {@code RepositoryDtoService}.
017 * @author Marco หงุ่ยตระกูล-Schulze - marco at codewizards dot co
018 */
019@XmlRootElement
020public class RepositoryDto {
021
022        private UUID repositoryId;
023
024        private byte[] publicKey;
025
026        private long revision = Long.MIN_VALUE;
027
028        public UUID getRepositoryId() {
029                return repositoryId;
030        }
031        public void setRepositoryId(UUID repositoryId) {
032                this.repositoryId = repositoryId;
033        }
034
035        public byte[] getPublicKey() {
036                return publicKey;
037        }
038        public void setPublicKey(byte[] publicKey) {
039                this.publicKey = publicKey;
040        }
041
042        public long getRevision() {
043                return revision;
044        }
045        public void setRevision(long revision) {
046                this.revision = revision;
047        }
048
049        @Override
050        public String toString() {
051                return this.getClass().getSimpleName() + "[repositoryId=" + repositoryId
052                                + ", publicKey=" + (publicKey == null ? null : Base64Url.encodeBase64ToString(publicKey))
053                                + ", revision=" + revision
054                                + "]";
055        }
056}