All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.api.beanStorageMethods.st Maven / Gradle / Ivy

/**
 * Return a {@link } 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 } object stored at this address
 */
public static  readByFields() {
    RaptureURI storageLocation 
      = new PathBuilder()
       
			        .buildStorageLocation();

        return ObjectStorage.read(storageLocation, .class, storableInfo, getObjectMapper());
}

/**
 * Get the folders or {@link } objects under parentFolderPath.
 * Searches the tree of objects of type {@link }
 * 
 * @param parentFolderPath
 * @return
 */
public static List\ getChildren(String parentFolderPath) {
    return ObjectStorage.getChildren(PathBuilder.getRepoName(), PathBuilder.getPrefix(), storableInfo, parentFolderPath);
}

/**
 * Removes the documents and folders {@link } objects under parentFolderPath.
 * 
 * @param parentFolderPath
 * @return
 */
public static List\ removeFolder(String parentFolderPath) {
    return ObjectStorage.removeFolder(PathBuilder.getRepoName(), PathBuilder.getPrefix(), storableInfo, parentFolderPath);
}

/**
 * Return all the {@link } objects currently stored in Rapture
 * @return
 */
public static List\<\> readAll() {
    return ObjectStorage.readAll(.class, PathBuilder.getRepoName(), PathBuilder.getPrefix(), storableInfo, "", getObjectMapper());
}

/**
 * Return all the {@link } objects currently stored in Rapture 
 * @param
 * filterPrefix The prefix of the storageLocation that you want to filter by
 * 
 * @return
 */
public static List\<\> readAll(String filterPrefix) {
    return ObjectStorage.readAll(.class, PathBuilder.getRepoName(), PathBuilder.getPrefix(), storableInfo, filterPrefix, getObjectMapper());
}

/**
 * Return all the {@link } 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
 */
public static List\<\> filterAll(ObjectFilter\<\> filter) {
    return ObjectStorage.filterAll(.class, PathBuilder.getRepoName(), PathBuilder.getPrefix(), storableInfo, "", filter, getObjectMapper());
}


/**
 * Visit the repository storing {@link } objects
 * 
 * @param visitor
 */
public static void visitAll(RepoVisitor visitor) {
    ObjectStorage.visitAll(PathBuilder.getRepoName(), PathBuilder.getPrefix(), "", storableInfo, visitor);
}


/**
 * Return a {@link } based on its storage location
 * 
 * @param storageLocationURI The storage location for this 
 * @return The {@link } object stored at this address
 */
public static  readByStorageLocation(RaptureURI storageLocation) {
    return ObjectStorage.read(storageLocation, .class, storableInfo, getObjectMapper());
}

/**
 * Read a {@link } from json
 * @param content The {@link JsonContent} to read
 * @return The {@link } object constructed from the json
 */
public static  readFromJson(JsonContent content) {
    return ObjectStorage.read(content, .class, getObjectMapper());
}


/**
 * Delete a  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
 */
public static Boolean deleteByFields(, String user, String comment) {
    RaptureURI storageLocation 
      = new PathBuilder()
       
              .buildStorageLocation();
    return ObjectStorage.delete(user, storageLocation, storableInfo.getIndexInfo(), comment);
}

/**
 * Delete a  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
 */
public static Boolean deleteByStorageLocation(RaptureURI storageLocation, String user, String comment) {
        return ObjectStorage.delete(user, storageLocation, storableInfo.getIndexInfo(), comment);
}

/**
 * Store a  into the repo, and add a comment
 * 
 * @param doc
 *            The  that will be stored
 * @param user
 *            The user doing the storing
 * @param comment
 */
public static void add( storable, String user, String comment) {
    ObjectStorage.write(storable, user, storableInfo, comment, getObjectMapper());
}

/**
 * Run a query on the repo where the index of  is stored
 * @param query
 * @return
 */
public static TableQueryResult queryIndex(String query) {
    return ObjectStorage.queryIndex(storableInfo, PathBuilder.getRepoName(), query);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy