Package org.jscsi.initiator.connection

Examples of org.jscsi.initiator.connection.Session


     */
    public final Session getSession (final Configuration initConfiguration, final String initTargetName, final InetSocketAddress inetAddress) {

        try {
            // Create a new Session
            final Session newSession = new Session(this, initConfiguration, initTargetName, inetAddress, Executors.newSingleThreadExecutor());
            return newSession;
        } catch (Exception e) {
            LOGGER.error("This exception is thrown: " + e);
            e.printStackTrace();
            return null;
View Full Code Here


     * @param targetName Name of the target, to which a connection should be created.
     * @throws Exception if any error occurs.
     */
    public final void createSession (final InetSocketAddress targetAddress, final String targetName) {

        final Session session = factory.getSession(configuration, targetName, targetAddress);
        sessions.put(session.getTargetName(), session);
        LOGGER.info("Created the session with iSCSI Target '" + targetName + "' at " + targetAddress.getHostName() + " on port " + targetAddress.getPort() + ".");
    }
View Full Code Here

     * @param targetName The name of the session, which instance you want.
     * @return The requested <code>Session</code> instance.
     */
    private final Session getSession (final String targetName) throws NoSuchSessionException {

        final Session session = sessions.get(targetName);

        if (session != null) {
            return session;
        } else {
            throw new NoSuchSessionException("Session " + targetName + " not found!");
View Full Code Here

     * @param sessionReq The Session to remove
     * @throws NoSuchSessionException if the Session does not exist in the Map
     */
    public final void removeSession (final Session sessionReq) throws NoSuchSessionException {

        final Session session = sessions.get(sessionReq.getTargetName());

        if (session != null) {
            sessions.remove(sessionReq.getTargetName());
        } else {
            throw new NoSuchSessionException("Session " + sessionReq.getTargetName() + " not found!");
View Full Code Here

TOP

Related Classes of org.jscsi.initiator.connection.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.