Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.core.model
Interface ISystemHostPool

All Superinterfaces:
IRSEPersistableContainer

public interface ISystemHostPool
extends IRSEPersistableContainer

An ordered list of connections ( IHost objects), owned by an ISystemProfile.

Implementations of this interface are expected to be thread-safe in the sense that integrity of the host list is maintained even if multiple threads call multiple methods in this interface concurrently.


Field Summary
 
Fields inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
NO_CHILDREN
 
Method Summary
 boolean addHost ( IHost conn)
          Add a new connection to the list.
  IHost cloneHost ( ISystemHostPool targetPool, IHost conn, String aliasName)
          Duplicates a given connection in this list within this list or another list.
  IHost createHost ( IRSESystemType systemType, String aliasName, String hostName)
          Create a connection object, given only the minimal information.
  IHost createHost ( IRSESystemType systemType, String aliasName, String hostName, String description)
          Create a connection object, given all the possible attributes except default userId.
  IHost createHost ( IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)
          Create a connection object, given all the possible attributes.
 void deleteHost ( IHost conn)
          Removes a given connection from the list and deletes it from disk.
  IHost getHost (int pos)
          Return the connection at the given zero-based offset.
  IHost getHost ( String aliasName)
          Return a connection object, given its alias name.
 int getHostCount ()
          Return the number of connections within this pool.
 int getHostPosition ( IHost conn)
          Return the zero-based position of a connection object within this host pool.
  IHost[] getHosts ()
          Return array of connections in this pool.
  String getName ()
          Return the name of this host pool.
  ISystemProfile getSystemProfile ()
          Return the system profile that owns this connection pool.
 void moveHosts ( IHost[] conns, int delta)
          Move existing connections a given number of positions in the same pool.
 void orderHosts ( String[] names)
          Order connections by alias name, in the order given by the names parameter.
 void renameHost ( IHost conn, String newName)
          Renames a given connection in the list.
 void renameHostPool ( String newName)
          Rename this connection pool.
 void updateHost ( IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)
          Update an existing connection given the new information.
 
Methods inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Method Detail

getSystemProfile

ISystemProfile getSystemProfile()
Return the system profile that owns this connection pool.

Returns:
the system profile that owns this connection pool.

getName

String getName()
Return the name of this host pool.

Returns:
The value of the Name attribute.

renameHostPool

void renameHostPool(
String newName)
Rename this connection pool.

Parameters:
newName - the new name for this connection pool.

getHosts

IHost[] getHosts()
Return array of connections in this pool. The returned array is a copy of the internal connection list. Modifications by clients will not affect the internal list of connections, but modifications to the array elements will affect the actual IHost objects maintained in the list.

Returns:
array of connections in this pool.

createHost

IHost createHost(
IRSESystemType systemType,
                 
String aliasName,
                 
String hostName)
Create a connection object, given only the minimal information.

THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.

Parameters:
systemType - system type matching one of the system types defined via the systemTypes extension point.
aliasName - unique connection name.
hostName - IP name or address of the host.
Returns:
IHost object, or null if it failed to create because the aliasName is not unique. All other errors throw an exception.

createHost

IHost createHost(
IRSESystemType systemType,
                 
String aliasName,
                 
String hostName,
                 
String description)
Create a connection object, given all the possible attributes except default userId.

THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.

Parameters:
systemType - system type matching one of the system types defined via the systemTypes extension point.
aliasName - unique connection name.
hostName - IP name or address of the host.
description - optional description of the connection. Can be null.
Returns:
IHost object, or null if it failed to create because the aliasName is not unique. All other errors throw an exception.

createHost

IHost createHost(
IRSESystemType systemType,
                 
String aliasName,
                 
String hostName,
                 
String description,
                 
String defaultUserId,
                 int defaultUserIdLocation)
Create a connection object, given all the possible attributes.

The new connection is added to the list and saved to disk.

Parameters:
systemType - system type matching one of the system types defined via the systemTypes extension point.
aliasName - unique connection name.
hostName - IP name or address of the host.
description - optional description of the connection. Can be null.
defaultUserId - userId to use as the default for the subsystems.
defaultUserIdLocation - where to set the given default user Id. See IRSEUserIdConstants for values.
Returns:
IHost object, or null if it failed to create because the aliasName is not unique.
See Also:
IRSEUserIdConstants

updateHost

void updateHost(
IHost conn,
                
IRSESystemType systemType,
                
String aliasName,
                
String hostName,
                
String description,
                
String defaultUserId,
                int defaultUserIdLocation)
Update an existing connection given the new information. This method:
  • calls the setXXX methods on the given connection object, updating the information in it.
  • saves the connection to disk (renaming its folder if needed)

Parameters:
conn - IHost to be updated
systemType - system type matching one of the system types defined via the systemType extension point.
aliasName - unique connection name.
hostName - IP name or address of the host.
description - optional description of the connection. Can be null.
defaultUserId - userId to use as the default for the subsystems.
defaultUserIdLocation - where to set the given default user Id from IRSEUserIdConstants.
See Also:
IRSEUserIdConstants

getHost

IHost getHost(
String aliasName)
Return a connection object, given its alias name. Can be used to test if an alias name is already used (non-null return).

Parameters:
aliasName - unique aliasName (case insensitive) to search on.
Returns:
IHost object with unique aliasName, or null if no connection object with this name exists.

getHost

IHost getHost(int pos)
Return the connection at the given zero-based offset.

Parameters:
pos - zero-based offset of requested connection in the connection list.
Returns:
IHost object requested.

addHost

boolean addHost(
IHost conn)
Add a new connection to the list.

This method will not ensure that the added connection's alias name is different (case-insensitive) than all other existing alias names. Clients are responsible for maintaining this invariant.

Parameters:
conn - Connection to add. Must not be null.
Returns:
true if the new connection was added successfully, false otherwise.

deleteHost

void deleteHost(
IHost conn)
Removes a given connection from the list and deletes it from disk.

This will:

  • Delete the connection in memory
  • Delete the underlying folder

Parameters:
conn - IHost object to remove

renameHost

void renameHost(
IHost conn,
                
String newName)
Renames a given connection in the list. This will:
  • Rename the profile in memory
  • Rename the underlying folder
  • Update the user preferences if this profile is currently active.

Parameters:
conn - IHost object to rename
newName - The new alias name to give that connection. The alias name is not checked for uniqueness. Clients are responsible themselves for ensuring that no two connections with the same alias name (compared case insensitive) are created.

getHostPosition

int getHostPosition(
IHost conn)
Return the zero-based position of a connection object within this host pool.

Parameters:
conn - connection to find in this host pool.
Returns:
the zero-based position of the requested connection in this host pool, or -1 if the connection was not found.

getHostCount

int getHostCount()
Return the number of connections within this pool.

Returns:
the number of IHost objects within this pool.

cloneHost

IHost cloneHost(
ISystemHostPool targetPool,
                
IHost conn,
                
String aliasName)
Duplicates a given connection in this list within this list or another list.

Parameters:
targetPool - The ISystemHostPool to hold the copied connection. Can equal this pool, as long as alias name is unique.
conn - IHost object (within our pool) to clone.
aliasName - New, unique, alias name to give this connection. Clone will fail (returning null as result) if this is not unique.
Returns:
the cloned host, or null if the new alias name was not unique.

moveHosts

void moveHosts(
IHost[] conns,
               int delta)
Move existing connections a given number of positions in the same pool. If the delta is negative, they are all moved up (left) by the given amount. If positive, they are all moved down (right) by the given amount.

  • After the move, the pool containing the moved connection is saved to disk.
  • The connection's alias name must be unique in pool.
TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION?

Parameters:
conns - an Array of hosts to move, can be empty but must not be null.
delta - the amount by which to move the hosts within this pool

orderHosts

void orderHosts(
String[] names)
Order connections by alias name, in the order given by the names parameter. Called after restore to order by user preferences. Alias names are case-insensitive. Existing connections in the internal connection list that do not match any alias name in the given name list, will be deleted from this host pool!

Parameters:
names - list of connection alias names in expected order.

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire