Interface NetworkManager
- All Known Implementing Classes:
StargateNetworkManager
-
Method Summary
Modifier and TypeMethodDescriptioncreateNetwork
(String targetNetwork, Set<PortalFlag> flags, boolean isForced) Creates a new network assigned to this registrycreateNetwork
(String name, NetworkType type, StorageType storageType, boolean isForced) Creates a new network assigned to this registryvoid
destroyPortal
(RealPortal portal) Saves to databasevoid
loadPortals
(StargateAPI stargateAPI) Loads all portals from storagevoid
Rename the network to specified name, saves to storagevoid
void
savePortal
(RealPortal portal, Network network) Add portal to network and save to storage@NotNull Network
selectNetwork
(String name, PermissionManager permissionManager, org.bukkit.OfflinePlayer player, Set<PortalFlag> flags) Interprets a networkname and type, then selects it or creates it if it does not already exist@NotNull Network
selectNetwork
(String name, NetworkType type, StorageType storageType) Gets the network with the given name, and creates it if it doesn't already exist
-
Method Details
-
selectNetwork
@NotNull @NotNull Network selectNetwork(String name, PermissionManager permissionManager, org.bukkit.OfflinePlayer player, Set<PortalFlag> flags) throws TranslatableException Interprets a networkname and type, then selects it or creates it if it does not already exist- Parameters:
name
-Initial name of the network
permissionManager
-A permission manager of the player
player
-The player selecting the network
flags
-flags of a portal this selection or creation comes from
- Returns:
The network the portal should be connected to
- Throws:
TranslatableException
-If invalid input is given
-
selectNetwork
@NotNull @NotNull Network selectNetwork(String name, NetworkType type, StorageType storageType) throws TranslatableException Gets the network with the given name, and creates it if it doesn't already exist- Parameters:
name
-The name of the network to get
type
-The type of network to get
storageType
-Whether or not the network works (or will work) across instances.
- Returns:
The network the portal should be connected to
- Throws:
TranslatableException
-If the network name is invalid
-
createNetwork
Network createNetwork(String name, NetworkType type, StorageType storageType, boolean isForced) throws InvalidNameException, UnimplementedFlagException, NameLengthException, NameConflictException Creates a new network assigned to this registry- Parameters:
name
-The name of the new network
type
-The type of network to create
storageType
-Whether to create it as a Interserver network
isForced
-The authority for the creation
- Returns:
The network created
- Throws:
InvalidNameException
-If the given network name is invalid
NameLengthException
NameConflictException
UnimplementedFlagException
-
createNetwork
Network createNetwork(String targetNetwork, Set<PortalFlag> flags, boolean isForced) throws InvalidNameException, NameLengthException, NameConflictException, UnimplementedFlagException Creates a new network assigned to this registry- Parameters:
targetNetwork
-The this network will attempt creation under
flags
-The flags containing the network's enabled options
isForced
-The authority for the creation
- Returns:
The network created
- Throws:
InvalidNameException
-If the given network name is invalid
NameLengthException
NameConflictException
UnimplementedFlagException
-
rename
void rename(Network network, String newName) throws InvalidNameException, NameLengthException, UnimplementedFlagException Rename the network to specified name, saves to storage- Parameters:
network
-The network to rename
newName
-The new name of the network
- Throws:
InvalidNameException
NameLengthException
UnimplementedFlagException
-
loadPortals
Loads all portals from storage- Parameters:
stargateAPI
-The stargate api
-
rename
- Parameters:
portal
-The portal to rename
newName
-The new name of the portal
- Throws:
NameConflictException
-
savePortal
Add portal to network and save to storage- Parameters:
portal
-The portal to be saved
network
-The network to assign the portal to
- Throws:
NameConflictException
-
destroyPortal
Saves to database- Parameters:
portal
-Destroy portal
-