001package co.codewizards.cloudstore.local.persistence;
002
003import java.util.UUID;
004
005import javax.jdo.annotations.NullValue;
006import javax.jdo.annotations.PersistenceCapable;
007import javax.jdo.annotations.Persistent;
008import javax.jdo.annotations.Queries;
009import javax.jdo.annotations.Query;
010import javax.jdo.annotations.Unique;
011
012@PersistenceCapable
013@Unique(name="RemoteRepositoryRequest_repositoryId", members="repositoryId")
014@Queries({
015        @Query(name="getRemoteRepositoryRequest_repositoryId", value="SELECT UNIQUE WHERE this.repositoryId == :repositoryId"),
016        @Query(name="getRemoteRepositoryRequestsChangedBefore_changed", value="SELECT WHERE this.changed < :changed")
017})
018public class RemoteRepositoryRequest extends Entity {
019
020        public RemoteRepositoryRequest() { }
021
022        @Persistent(nullValue=NullValue.EXCEPTION)
023        private String repositoryId;
024
025        @Persistent(nullValue=NullValue.EXCEPTION)
026        private byte[] publicKey;
027
028        @Persistent(nullValue=NullValue.EXCEPTION)
029        private String localPathPrefix;
030
031        public UUID getRepositoryId() {
032                return repositoryId == null ? null : UUID.fromString(repositoryId);
033        }
034        public void setRepositoryId(UUID repositoryId) {
035                this.repositoryId = repositoryId == null ? null : repositoryId.toString();
036        }
037
038        public byte[] getPublicKey() {
039                return publicKey;
040        }
041
042        public void setPublicKey(byte[] publicKey) {
043                this.publicKey = publicKey;
044        }
045
046        public String getLocalPathPrefix() {
047                return localPathPrefix;
048        }
049        public void setLocalPathPrefix(String localPathPrefix) {
050                this.localPathPrefix = localPathPrefix;
051        }
052}