Package org.jumpmind.symmetric.service
Interface IRegistrationService
- All Known Implementing Classes:
RegistrationService
public interface IRegistrationService
This service provides an API that deals with
Node
registration-
Method Summary
Modifier and TypeMethodDescriptionboolean
attemptToRegisterWithServer
(int maxNumberOfAttempts) Client method which attempts to register with the registration.url to pull configuration if the node has not already been registered.boolean
getRedirectionUrlFor
(String externalId) getRegistrationRequests
(boolean includeNodesWithOpenRegistrations, boolean includeRejects) boolean
boolean
boolean
boolean
isRegistrationOpen
(String nodeGroupId, String externalId) boolean
loadRegistrationBatch
(Node node, InputStream is, OutputStream os) When server pushes to client asking to register it, the client loads the configuration batch and returns an acknowledgementvoid
markNodeAsRegistered
(String nodeId) Mark the passed in node as registered in node_securityopenRegistration
(String nodeGroupId, String externalId) Open registration for a single new node given a node group (f.e., "STORE") and external ID (f.e., "00001").openRegistration
(String nodeGroup, String externalId, String remoteHost, String remoteAddress) openRegistration
(String nodeGroup, String externalId, String syncUrl, Date notBefore, Date notAfter) openRegistration
(Node node) boolean
registerNode
(Node node, OutputStream out, boolean isRequestedRegistration) Register a node for the given group name and external id if the registration is open.boolean
registerNode
(Node node, String remoteHost, String remoteAddress, OutputStream out, String userId, String password, boolean isRequestedRegistration) Register a node for the given group name and external id if the registration is open.registerPullOnlyNode
(String externalId, String nodeGroupId, String databaseType, String databaseVersion, String databseName) Register a "Pull Only" node.registerWithClient
(Node remote, IOutgoingWithResponseTransport transport) Server method which attempts to register using the registration URL of a client node using a push to send configuration.boolean
Client method which attempts to register with the registration.url to pull configuration if the node has not already been registered.void
reOpenRegistration
(String nodeId) Re-open registration for a single node that already exists in the database.void
reOpenRegistration
(String nodeId, boolean forceNewPassword) void
void
saveRegistrationRedirect
(String externalIdToRedirect, String nodeIdToRedirectTo) Add an entry to the registation_redirect table so that if a node tries to register here.void
void
setAllowClientRegistration
(boolean enabled) boolean
When server pushes to client asking to register it, the client responds with its registration request properties
-
Method Details
-
registerPullOnlyNode
Node registerPullOnlyNode(String externalId, String nodeGroupId, String databaseType, String databaseVersion, String databseName) throws IOException Register a "Pull Only" node. This type of node has no Symmetric configuration and can only be used to PULL data from another node. It can never track changes or push data to other nodes. When a node of this type is registered, it must complete all symmetric client functionality by itself including issue the pull, acknowledging batches, etc.- Parameters:
externalId
-nodeGroupId
-databaseType
-databaseVersion
-- Throws:
IOException
-
registerNode
boolean registerNode(Node node, String remoteHost, String remoteAddress, OutputStream out, String userId, String password, boolean isRequestedRegistration) throws IOException Register a node for the given group name and external id if the registration is open.- Parameters:
isRequestedRegistration
- An indicator that registration has been requested by the remote client- Throws:
IOException
-
registerNode
boolean registerNode(Node node, OutputStream out, boolean isRequestedRegistration) throws IOException Register a node for the given group name and external id if the registration is open.- Parameters:
isRequestedRegistration
- An indicator that registration has been requested by the remote client- Throws:
IOException
-
openRegistration
Open registration for a single new node given a node group (f.e., "STORE") and external ID (f.e., "00001"). The unique node ID and password are generated and stored in the node and node_security tables with the registration_enabled flag turned on. The next node to try registering for this node group and external ID will be given this information.- Returns:
- the node id
-
openRegistration
-
openRegistration
-
openRegistration
-
isRegistrationOpen
-
isRegistrationOpen
boolean isRegistrationOpen() -
reOpenRegistration
Re-open registration for a single node that already exists in the database. A new password is generated and the registration_enabled flag is turned on. The next node to try registering for this node group and external ID will be given this information. -
reOpenRegistration
-
markNodeAsRegistered
Mark the passed in node as registered in node_security- Parameters:
nodeId
- is the node that has just finished 'successfully' registering
-
isAutoRegistration
boolean isAutoRegistration() -
registerWithServer
boolean registerWithServer()Client method which attempts to register with the registration.url to pull configuration if the node has not already been registered. If the registration server cannot be reach this method will continue to try with random sleep periods up to one minute up until the registration succeeds or the maximum number of attempts has been reached. Returns true if we had to register with server and was successful. Returns false if we did not have to register. -
registerWithClient
Server method which attempts to register using the registration URL of a client node using a push to send configuration. Returns configuration batch sent with its status. -
attemptToRegisterWithServer
boolean attemptToRegisterWithServer(int maxNumberOfAttempts) Client method which attempts to register with the registration.url to pull configuration if the node has not already been registered. Returns true if registered successfully -
getRegistrationRequests
List<RegistrationRequest> getRegistrationRequests(boolean includeNodesWithOpenRegistrations, boolean includeRejects) -
deleteRegistrationRequest
-
saveRegistrationRequest
-
isRegisteredWithServer
boolean isRegisteredWithServer() -
saveRegistrationRedirect
Add an entry to the registation_redirect table so that if a node tries to register here. It will be redirected to the correct node. -
getRedirectionUrlFor
-
requestNodeCopy
void requestNodeCopy() -
setAllowClientRegistration
void setAllowClientRegistration(boolean enabled) -
writeRegistrationProperties
When server pushes to client asking to register it, the client responds with its registration request properties -
loadRegistrationBatch
When server pushes to client asking to register it, the client loads the configuration batch and returns an acknowledgement
-