Package org.sgrewritten.stargate.network
Class StargateNetworkRegistry
java.lang.Object
org.sgrewritten.stargate.network.StargateNetworkRegistry
- All Implemented Interfaces:
NetworkRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all stored networksvoid
Close all portals of the networks contained in this registrygetFromName
(String name) getNetwork
(String name) Gets the network with the giveniterator()
boolean
networkExists
(String networkName) Checks whether the given network name existsboolean
networkNameExists
(String name) void
registerNetwork
(Network network) UseNetworkManager
instead.void
renameNetwork
(String newId, String oldId) UseNetworkManager
instead.int
size()
stream()
void
unregisterNetwork
(Network network) UseNetworkManager
instead.void
Update all portals stored in the network
-
Constructor Details
-
StargateNetworkRegistry
public StargateNetworkRegistry()
-
-
Method Details
-
renameNetwork
public void renameNetwork(String newId, String oldId) throws InvalidNameException, UnimplementedFlagException, NameLengthException Description copied from interface:NetworkRegistry
UseNetworkManager
instead. This does not save to database, and is not cross server compatible- Specified by:
renameNetwork
in interfaceNetworkRegistry
- Parameters:
newId
-oldId
-- Throws:
InvalidNameException
UnimplementedFlagException
NameLengthException
-
unregisterNetwork
Description copied from interface:NetworkRegistry
UseNetworkManager
instead. This does not save to database, and is not cross server compatible- Specified by:
unregisterNetwork
in interfaceNetworkRegistry
- Parameters:
network
-
-
registerNetwork
Description copied from interface:NetworkRegistry
UseNetworkManager
instead. This does not save to database, and is not cross server compatible- Specified by:
registerNetwork
in interfaceNetworkRegistry
- Parameters:
network
-
-
networkExists
Description copied from interface:NetworkRegistry
Checks whether the given network name exists- Specified by:
networkExists
in interfaceNetworkRegistry
- Parameters:
networkName
-The network name to check
- Returns:
True if the network exists
-
getNetwork
Description copied from interface:NetworkRegistry
Gets the network with the given- Specified by:
getNetwork
in interfaceNetworkRegistry
- Parameters:
name
-The name of the network to get
- Returns:
The network with the given name
-
clear
public void clear()Description copied from interface:NetworkRegistry
Clear all stored networks- Specified by:
clear
in interfaceNetworkRegistry
-
updatePortals
public void updatePortals()Description copied from interface:NetworkRegistry
Update all portals stored in the network- Specified by:
updatePortals
in interfaceNetworkRegistry
-
stream
- Specified by:
stream
in interfaceNetworkRegistry
- Returns:
A stream of all networks
-
iterator
- Specified by:
iterator
in interfaceNetworkRegistry
- Returns:
An iterator of all networks
-
networkNameExists
- Specified by:
networkNameExists
in interfaceNetworkRegistry
- Parameters:
name
-The name of the network
- Returns:
Whether any network has that name
-
getFromName
- Specified by:
getFromName
in interfaceNetworkRegistry
- Parameters:
name
-The name of the network
- Returns:
The network of that name
-
closeAllPortals
public void closeAllPortals()Description copied from interface:NetworkRegistry
Close all portals of the networks contained in this registry- Specified by:
closeAllPortals
in interfaceNetworkRegistry
-
size
public int size()- Specified by:
size
in interfaceNetworkRegistry
- Returns:
The amount of networks stored in this registry
-