Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* The MIT License (MIT)
*
* Copyright (C) 2011-2016 Incapture Technologies LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*//**
* This file is autogenerated and any changes will be overwritten.
*/
package rapture.common;
import rapture.common.RaptureFolderInfo;
import rapture.common.RaptureURI;
import rapture.common.TableQueryResult;
import rapture.object.storage.StorageLocationFactory;
import rapture.common.impl.jackson.JsonContent;
import rapture.object.storage.ObjectFilter;
import rapture.object.storage.ObjectStorage;
import rapture.persistence.storable.mapper.impl.jackson.StorableObjectMapper;
import rapture.repo.RepoVisitor;
import java.util.List;
import org.apache.log4j.Logger;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import rapture.common.impl.jackson.JacksonUtil;
import java.io.IOException;
import rapture.server.ServerApiVersion;
import rapture.common.version.OldestVersion;
@SuppressWarnings("all")
publicclassJobLinkStatusStorage{
privatestaticfinal Logger log = Logger.getLogger(JobLinkStatusStorage.class);
privatestaticfinal JobLinkStatusStorableInfo storableInfo = new JobLinkStatusStorableInfo();
/**
* Return a {@link JobLinkStatus} based on its member fields. This is useful if you know the value of
* the member fields of the object, but not the exact storage location or address.
*
* @return The {@link JobLinkStatus} object stored at this address
*/publicstatic JobLinkStatus readByFields(String to, String from) {
RaptureURI storageLocation
= new JobLinkStatusPathBuilder()
.to(to)
.from(from)
.buildStorageLocation();
return ObjectStorage.read(storageLocation, JobLinkStatus.class, storableInfo, getObjectMapper());
}
/**
* Get the folders or {@link JobLinkStatus} objects under parentFolderPath.
* Searches the tree of objects of type {@link JobLinkStatus}
*
* @param parentFolderPath
* @return
*/publicstaticList getChildren(String parentFolderPath) {
return ObjectStorage.getChildren(JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), storableInfo, parentFolderPath);
}
/**
* Removes the documents and folders {@link JobLinkStatus} objects under parentFolderPath.
*
* @param parentFolderPath
* @return
*/publicstaticList removeFolder(String parentFolderPath) {
return ObjectStorage.removeFolder(JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), storableInfo, parentFolderPath);
}
/**
* Return all the {@link JobLinkStatus} objects currently stored in Rapture
* @return
*/publicstaticList readAll() {
return ObjectStorage.readAll(JobLinkStatus.class, JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), storableInfo, "", getObjectMapper());
}
/**
* Return all the {@link JobLinkStatus} objects currently stored in Rapture
* @param
* filterPrefix The prefix of the storageLocation that you want to filter by
*
* @return
*/publicstaticList readAll(String filterPrefix) {
return ObjectStorage.readAll(JobLinkStatus.class, JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), storableInfo, filterPrefix, getObjectMapper());
}
/**
* Return all the {@link JobLinkStatus} objects currently stored in Rapture which match an ObjectFilter
* @param
* filterPrefix The prefix of the storageLocation that you want to filter by
* @param
* filter An ObjectFilter
*
* @return
*/publicstaticList filterAll(ObjectFilter filter) {
return ObjectStorage.filterAll(JobLinkStatus.class, JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), storableInfo, "", filter, getObjectMapper());
}
/**
* Visit the repository storing {@link JobLinkStatus} objects
*
* @param visitor
*/publicstatic void visitAll(RepoVisitor visitor) {
ObjectStorage.visitAll(JobLinkStatusPathBuilder.getRepoName(), JobLinkStatusPathBuilder.getPrefix(), "", storableInfo, visitor);
}
/**
* Return a {@link JobLinkStatus} based on its storage location
*
* @param storageLocationURI The storage location for this JobLinkStatus
* @return The {@link JobLinkStatus} object stored at this address
*/publicstatic JobLinkStatus readByStorageLocation(RaptureURI storageLocation) {
return ObjectStorage.read(storageLocation, JobLinkStatus.class, storableInfo, getObjectMapper());
}
/**
* Read a {@link JobLinkStatus} from json
* @param content The {@link JsonContent} to read
* @return The {@link JobLinkStatus} object constructed from the json
*/publicstatic JobLinkStatus readFromJson(JsonContent content) {
return ObjectStorage.read(content, JobLinkStatus.class, getObjectMapper());
}
/**
* Delete a JobLinkStatus from the repo, using its member fields to find it.
* @param user The user doing the delete
* @param comment The comment associated with the delete
* @return
*/publicstatic Boolean deleteByFields(String to, String from, String user, String comment) {
RaptureURI storageLocation
= new JobLinkStatusPathBuilder()
.to(to)
.from(from)
.buildStorageLocation();
return ObjectStorage.delete(user, storageLocation, storableInfo.getIndexInfo(), comment);
}
/**
* Delete a JobLinkStatus from the repo.
* @param storageLocation The storage location of the object in the repo
* @param user The user doing the delete
* @param comment The comment associated with the delete
* @return
*/publicstatic Boolean deleteByStorageLocation(RaptureURI storageLocation, String user, String comment) {
return ObjectStorage.delete(user, storageLocation, storableInfo.getIndexInfo(), comment);
}
/**
* Store a JobLinkStatus into the repo, and add a comment
*
* @param doc
* The JobLinkStatus that will be stored
* @param user
* The user doing the storing
* @param comment
*/publicstatic void add(JobLinkStatus storable, String user, String comment) {
ObjectStorage.write(storable, user, storableInfo, comment, getObjectMapper());
}
/**
* Run a query on the repo where the index of JobLinkStatus is stored
* @param query
* @return
*/publicstatic TableQueryResult queryIndex(String query) {
return ObjectStorage.queryIndex(storableInfo, JobLinkStatusPathBuilder.getRepoName(), query);
}
/**
* Get the ObjectMapper for this object
*
* @return The ObjectMapper
*/privatestatic ObjectMapper getObjectMapper() {
return StorableObjectMapper.getMapper();
}
static {
StorableObjectMapper.addSerDes(JobLinkStatus.class, new JobLinkStatusSerializer(), new JobLinkStatusDeserializer());
}
privatestaticclassJobLinkStatusDeserializerextendsJsonDeserializer{
@Override
public JobLinkStatus deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JobLinkStatus jobLinkStatus = JacksonUtil.DEFAULT_MAPPER.readValue(p, JobLinkStatus.class);
jobLinkStatus.set_raptureVersion(ServerApiVersion.getApiVersion());
return jobLinkStatus;
}
}
privatestaticclassJobLinkStatusSerializerextendscom.fasterxml.jackson.databind.JsonSerializer{
@Override
public void serialize(JobLinkStatus value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
value.set_raptureVersion(ServerApiVersion.getApiVersion());
gen.writeRaw(JacksonUtil.DEFAULT_MAPPER.writeValueAsString(value));
}
}
}