Package emissary.admin
Class Startup
- java.lang.Object
-
- emissary.admin.Startup
-
public class Startup extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTIONADD
static String
ACTIONDELETE
static String
ACTIONSTART
protected static Set<String>
activeDirPlaces
static int
DIRECTORYADD
static int
DIRECTORYDELETE
static int
DIRECTORYSTART
protected Map<String,String>
failedLocalDirectories
protected Set<String>
failedPlaces
protected Configurator
hostsConfig
protected static boolean
invisPlacesStartedInStrictMode
protected Map<String,String>
localDirectories
protected Map<String,Set<String>>
pickupLists
protected static Set<String>
placeAlreadyStarted
protected Map<String,Set<String>>
placeLists
protected static Map<String,String>
places
protected Set<String>
placesToStart
-
Constructor Summary
Constructors Constructor Description Startup(Configurator config, EmissaryNode node)
Startup(InputStream startupConfigStream, EmissaryNode node)
Startup(String startupConfigFile, EmissaryNode node)
Class constructor loads the config file
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bootstrap()
static Set<String>
getInvisPlaces()
protected static String
getLocationName(String location)
static boolean
isInvisPlacesStartedInStrictMode()
protected boolean
localDirectorySetup(Map<String,String> localDirectoriesArg)
static void
main(String[] args)
The main entry pointstatic String
placeHost(String key)
n return the full DNS name and port without the protocol partstatic String
placeName(String key)
return the type of place specified Key manipulator does not work on this, though it seems to if the key has dots in the hostname like many do.protected boolean
placeSetup(int directoryActionArg, Map<String,String> localDirectoriesArg, Map<String,String> placesArg, Set<String> hostParameters)
Start all places on the list on a thread, return control immediately.static int
setAction(String optarg)
Set the action based on the command line argumentprotected void
sortPlaces(List<String> placeList)
sort all the PLACE entries into either a processing place or a pickup placevoid
start()
Start the systemprotected void
stopAndWaitForPlaceCreation()
Check to see if all the places have started and been registered in the directory.static boolean
verifyNoInvisiblePlacesStarted()
Verifies the active directory places vs places started up.
-
-
-
Field Detail
-
DIRECTORYSTART
public static final int DIRECTORYSTART
- See Also:
- Constant Field Values
-
DIRECTORYADD
public static final int DIRECTORYADD
- See Also:
- Constant Field Values
-
DIRECTORYDELETE
public static final int DIRECTORYDELETE
- See Also:
- Constant Field Values
-
ACTIONADD
public static final String ACTIONADD
- See Also:
- Constant Field Values
-
ACTIONDELETE
public static final String ACTIONDELETE
- See Also:
- Constant Field Values
-
ACTIONSTART
public static final String ACTIONSTART
- See Also:
- Constant Field Values
-
hostsConfig
@Nullable protected Configurator hostsConfig
-
invisPlacesStartedInStrictMode
protected static boolean invisPlacesStartedInStrictMode
-
-
Constructor Detail
-
Startup
public Startup(String startupConfigFile, EmissaryNode node) throws IOException
Class constructor loads the config file- Throws:
IOException
-
Startup
public Startup(InputStream startupConfigStream, EmissaryNode node) throws IOException
- Throws:
IOException
-
Startup
public Startup(Configurator config, EmissaryNode node)
-
-
Method Detail
-
placeHost
public static String placeHost(String key)
n return the full DNS name and port without the protocol part
-
placeName
public static String placeName(String key)
return the type of place specified Key manipulator does not work on this, though it seems to if the key has dots in the hostname like many do.
-
setAction
public static int setAction(String optarg)
Set the action based on the command line argument
-
main
public static void main(String[] args) throws IOException, EmissaryException
The main entry point- Throws:
IOException
EmissaryException
-
start
public void start() throws EmissaryException
Start the system- Throws:
EmissaryException
-
bootstrap
public boolean bootstrap()
-
placeSetup
protected boolean placeSetup(int directoryActionArg, Map<String,String> localDirectoriesArg, Map<String,String> placesArg, Set<String> hostParameters)
Start all places on the list on a thread, return control immediately. All places in hostParameters list must be for the same host:port!
-
stopAndWaitForPlaceCreation
protected void stopAndWaitForPlaceCreation()
Check to see if all the places have started and been registered in the directory. This doesn't account for directories, just things started with a "PLACE" tag
-
sortPlaces
protected void sortPlaces(List<String> placeList)
sort all the PLACE entries into either a processing place or a pickup place
-
verifyNoInvisiblePlacesStarted
public static boolean verifyNoInvisiblePlacesStarted()
Verifies the active directory places vs places started up. Log if any places are started without being announced in start-up.- Returns:
- true if no invisible places started, false if yes
-
isInvisPlacesStartedInStrictMode
public static boolean isInvisPlacesStartedInStrictMode()
-
-