Package org.sgrewritten.stargate.network
Class StargateNetworkRegistry
java.lang.Object
org.sgrewritten.stargate.network.StargateNetworkRegistry
- All Implemented Interfaces:
NetworkRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all stored networksvoidClose all portals of the networks contained in this registrygetFromName(String name) getNetwork(String name) Gets the network with the giveniterator()booleannetworkExists(String networkName) Checks whether the given network name existsbooleannetworkNameExists(String name) voidregisterNetwork(Network network) UseNetworkManagerinstead.voidrenameNetwork(String newId, String oldId) UseNetworkManagerinstead.intsize()stream()voidunregisterNetwork(Network network) UseNetworkManagerinstead.voidUpdate 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:NetworkRegistryUseNetworkManagerinstead. This does not save to database, and is not cross server compatible- Specified by:
renameNetworkin interfaceNetworkRegistry- Parameters:
newId-oldId-- Throws:
InvalidNameExceptionUnimplementedFlagExceptionNameLengthException
-
unregisterNetwork
Description copied from interface:NetworkRegistryUseNetworkManagerinstead. This does not save to database, and is not cross server compatible- Specified by:
unregisterNetworkin interfaceNetworkRegistry- Parameters:
network-
-
registerNetwork
Description copied from interface:NetworkRegistryUseNetworkManagerinstead. This does not save to database, and is not cross server compatible- Specified by:
registerNetworkin interfaceNetworkRegistry- Parameters:
network-
-
networkExists
Description copied from interface:NetworkRegistryChecks whether the given network name exists- Specified by:
networkExistsin interfaceNetworkRegistry- Parameters:
networkName-The network name to check
- Returns:
True if the network exists
-
getNetwork
Description copied from interface:NetworkRegistryGets the network with the given- Specified by:
getNetworkin 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:NetworkRegistryClear all stored networks- Specified by:
clearin interfaceNetworkRegistry
-
updatePortals
public void updatePortals()Description copied from interface:NetworkRegistryUpdate all portals stored in the network- Specified by:
updatePortalsin interfaceNetworkRegistry
-
stream
- Specified by:
streamin interfaceNetworkRegistry- Returns:
A stream of all networks
-
iterator
- Specified by:
iteratorin interfaceNetworkRegistry- Returns:
An iterator of all networks
-
networkNameExists
- Specified by:
networkNameExistsin interfaceNetworkRegistry- Parameters:
name-The name of the network
- Returns:
Whether any network has that name
-
getFromName
- Specified by:
getFromNamein interfaceNetworkRegistry- Parameters:
name-The name of the network
- Returns:
The network of that name
-
closeAllPortals
public void closeAllPortals()Description copied from interface:NetworkRegistryClose all portals of the networks contained in this registry- Specified by:
closeAllPortalsin interfaceNetworkRegistry
-
size
public int size()- Specified by:
sizein interfaceNetworkRegistry- Returns:
The amount of networks stored in this registry
-