IOExitPath.java interface

IOExitPath.java

/*
 *   Licensed Materials - Property of IBM
 *
 *   “Restricted Materials of IBM”
 *
 *   5724-H72
 * 
 *    Copyright IBM Corp. 2011, 2024. All Rights Reserved.
 * 
 *   US Government Users Restricted Rights - Use, duplication or
 *   disclosure restricted by GSA ADP Schedule Contract with
 *   IBM Corp.
 */
package com.ibm.wmqfte.exitroutine.api;

/**
 * Represents an abstract path that can be inspected and queried by WMQFTE for
 * transfer purposes.
 * <p>
 * There are two types of path supported:
 * <ul>
 * <li>{@link IOExitResourcePath} - Represents a path that denotes a data
 * resource. For example, a file, directory, or group of database records.</li>
 * <li>{@link IOExitWildcardPath} - Represents a wildcard path that can be
 * expanded to multiple {@link IOExitResourcePath} instances.</li>
 * </ul>
 */
public abstract interface IOExitPath {

	/**
	 * Obtains the abstract path as a {@link String}.
	 * 
	 * @return The abstract path as a {@link String}.
	 */
	String getPath();

	/**
	 * Obtains the name portion of this abstract path as a {@link String}.
	 * <p>
	 * For example, a UNIX-style file system implementation evaluates the
	 * path {@code /home/fteuser/file1.txt} as having a name of {@code
	 * file1.txt}.
	 * 
	 * @return the name portion of this abstract path as a {@link String}.
	 */
	String getName();

	/**
	 * Obtains the parent path for this abstract path as a {@link String}.
	 * <p>
	 * For example, a UNIX-style file system implementation evaluates the
	 * path {@code /home/fteuser/file1.txt} as having a parent path of {@code
	 * /home/fteuser}.
	 * 
	 * @return The parent portion of the path as a {@link String}.
	 */
	String getParent();

	/**
	 * Obtains the abstract paths that match this abstract path.
	 * <p>
	 * If this abstract path denotes a directory resource, a list of paths
	 * for all resources within the directory are returned.
	 * <p>
	 * If this abstract path denotes a wildcard, a list of all paths
	 * matching the wildcard are returned.
	 * <p>
	 * Otherwise null is returned, because this abstract path probably denotes a
	 * single file resource.
	 * 
	 * @return An array of {@IOExitResourcePath}s that
	 *         match this path, or null if this method is not applicable.
	 */
	IOExitResourcePath[] listPaths();
}