Class RegistrationService
java.lang.Object
org.jumpmind.symmetric.service.impl.AbstractService
org.jumpmind.symmetric.service.impl.RegistrationService
- All Implemented Interfaces:
IRegistrationService,IService
- See Also:
-
Field Summary
Fields inherited from class org.jumpmind.symmetric.service.impl.AbstractService
log, parameterService, platform, sqlTemplate, sqlTemplateDirty, symmetricDialect, tablePrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanattemptToRegisterWithServer(int maxNumberOfAttempts) Client method which attempts to register with the registration.url to pull configuration if the node has not already been registered.protected booleancheckRegistrationSuccessful(boolean registered, int maxNumberOfAttempts) booleanprotected voidextractConfiguration(OutputStream out, Node registeredNode) getRedirectionUrlFor(String externalId) getRegistrationRequests(boolean includeNodesWithOpenRegistrations, boolean includeRejects) booleanbooleanbooleanbooleanisRegistrationOpen(String nodeGroupId, String externalId) booleanloadRegistrationBatch(Node node, InputStream is, OutputStream os) When server pushes to client asking to register it, the client loads the configuration batch and returns an acknowledgementvoidmarkNodeAsRegistered(String nodeId) Mark the passed in node as registered in node_securityprotected voidmarkNodeAsRegistrationPending(String nodeId) openRegistration(String nodeGroup, 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) protected Stringprotected NodeprocessRegistration(Node nodePriorToRegistration, String remoteHost, String remoteAddress, String userId, String password, boolean isRequestedRegistration) booleanregisterNode(Node preRegisteredNode, OutputStream out, boolean isRequestedRegistration) Register a node for the given group name and external id if the registration is open.booleanregisterNode(Node nodePriorToRegistration, 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 databaseName) 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.booleanClient method which attempts to register with the registration.url to pull configuration if the node has not already been registered.voidreOpenRegistration(String nodeId) Re-open registration for a single node that already exists in the database.voidreOpenRegistration(String nodeId, boolean forceNewPassword) protected voidreOpenRegistration(String nodeId, String remoteHost, String remoteAddress, Date notBefore, Date notAfter, boolean forceNewPassword) voidvoidsaveRegistrationRedirect(String externalIdToRedirect, String nodeIdToRedirectTo) Add an entry to the registation_redirect table so that if a node tries to register here.voidvoidsetAllowClientRegistration(boolean enabled) booleanWhen server pushes to client asking to register it, the client responds with its registration request propertiesMethods inherited from class org.jumpmind.symmetric.service.impl.AbstractService
assertNotNull, buildBatchOrderBy, buildBatchParams, buildBatchWhere, buildBatchWhereFromFilter, close, createSqlReplacementTokens, getJdbcTemplate, getParameterService, getSql, getSymmetricDialect, getTablePrefix, getTargetDialect, getTargetPlatform, getTargetPlatform, isCalledFromSymmetricAdminTool, isSet, isStreamClosedByClient, isSymmetricTable, logOnce, maxDate, readAcks, sendAck, setSqlMap, synchronize, toNodeIds, toNodeIds
-
Constructor Details
-
RegistrationService
-
-
Method Details
-
registerPullOnlyNode
public Node registerPullOnlyNode(String externalId, String nodeGroupId, String databaseType, String databaseVersion, String databaseName) throws IOException Description copied from interface:IRegistrationServiceRegister 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.- Specified by:
registerPullOnlyNodein interfaceIRegistrationService- Throws:
IOException
-
registerNode
public boolean registerNode(Node preRegisteredNode, OutputStream out, boolean isRequestedRegistration) throws IOException Description copied from interface:IRegistrationServiceRegister a node for the given group name and external id if the registration is open.- Specified by:
registerNodein interfaceIRegistrationServiceisRequestedRegistration- An indicator that registration has been requested by the remote client- Throws:
IOException
-
extractConfiguration
-
processRegistration
protected Node processRegistration(Node nodePriorToRegistration, String remoteHost, String remoteAddress, String userId, String password, boolean isRequestedRegistration) throws IOException - Throws:
IOException
-
registerNode
public boolean registerNode(Node nodePriorToRegistration, String remoteHost, String remoteAddress, OutputStream out, String userId, String password, boolean isRequestedRegistration) throws IOException Description copied from interface:IRegistrationServiceRegister a node for the given group name and external id if the registration is open.- Specified by:
registerNodein interfaceIRegistrationServiceisRequestedRegistration- An indicator that registration has been requested by the remote client- Throws:
IOException- See Also:
-
getRegistrationRequests
public List<RegistrationRequest> getRegistrationRequests(boolean includeNodesWithOpenRegistrations, boolean includeRejects) - Specified by:
getRegistrationRequestsin interfaceIRegistrationService
-
deleteRegistrationRequest
- Specified by:
deleteRegistrationRequestin interfaceIRegistrationService
-
saveRegistrationRequest
- Specified by:
saveRegistrationRequestin interfaceIRegistrationService
-
getRedirectionUrlFor
- Specified by:
getRedirectionUrlForin interfaceIRegistrationService
-
saveRegistrationRedirect
Description copied from interface:IRegistrationServiceAdd an entry to the registation_redirect table so that if a node tries to register here. It will be redirected to the correct node.- Specified by:
saveRegistrationRedirectin interfaceIRegistrationService
-
markNodeAsRegistered
Description copied from interface:IRegistrationServiceMark the passed in node as registered in node_security- Specified by:
markNodeAsRegisteredin interfaceIRegistrationService- Parameters:
nodeId- is the node that has just finished 'successfully' registering- See Also:
-
IRegistrationService#markNodeAsRegistered(Node)
-
markNodeAsRegistrationPending
-
isRegisteredWithServer
public boolean isRegisteredWithServer()- Specified by:
isRegisteredWithServerin interfaceIRegistrationService
-
registerWithServer
public boolean registerWithServer()Description copied from interface:IRegistrationServiceClient 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.- Specified by:
registerWithServerin interfaceIRegistrationService- See Also:
-
attemptToRegisterWithServer
public boolean attemptToRegisterWithServer(int maxNumberOfAttempts) Description copied from interface:IRegistrationServiceClient 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- Specified by:
attemptToRegisterWithServerin interfaceIRegistrationService
-
checkRegistrationSuccessful
protected boolean checkRegistrationSuccessful(boolean registered, int maxNumberOfAttempts) -
registerWithClient
public List<OutgoingBatch> registerWithClient(Node remote, IOutgoingWithResponseTransport transport) Description copied from interface:IRegistrationServiceServer 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.- Specified by:
registerWithClientin interfaceIRegistrationService
-
writeRegistrationProperties
Description copied from interface:IRegistrationServiceWhen server pushes to client asking to register it, the client responds with its registration request properties- Specified by:
writeRegistrationPropertiesin interfaceIRegistrationService
-
loadRegistrationBatch
Description copied from interface:IRegistrationServiceWhen server pushes to client asking to register it, the client loads the configuration batch and returns an acknowledgement- Specified by:
loadRegistrationBatchin interfaceIRegistrationService
-
reOpenRegistration
Description copied from interface:IRegistrationServiceRe-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.- Specified by:
reOpenRegistrationin interfaceIRegistrationService- See Also:
-
reOpenRegistration
- Specified by:
reOpenRegistrationin interfaceIRegistrationService
-
reOpenRegistration
-
openRegistration
Description copied from interface:IRegistrationServiceOpen 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.- Specified by:
openRegistrationin interfaceIRegistrationService- Returns:
- The nodeId of the registered node
- See Also:
-
openRegistration
public String openRegistration(String nodeGroup, String externalId, String syncUrl, Date notBefore, Date notAfter) - Specified by:
openRegistrationin interfaceIRegistrationService
-
openRegistration
public String openRegistration(String nodeGroup, String externalId, String remoteHost, String remoteAddress) - Specified by:
openRegistrationin interfaceIRegistrationService
-
openRegistration
- Specified by:
openRegistrationin interfaceIRegistrationService
-
openRegistration
-
isAutoRegistration
public boolean isAutoRegistration()- Specified by:
isAutoRegistrationin interfaceIRegistrationService
-
isRegistrationOpen
- Specified by:
isRegistrationOpenin interfaceIRegistrationService
-
isRegistrationOpen
public boolean isRegistrationOpen()- Specified by:
isRegistrationOpenin interfaceIRegistrationService
-
requestNodeCopy
public void requestNodeCopy()- Specified by:
requestNodeCopyin interfaceIRegistrationService
-
setAllowClientRegistration
public void setAllowClientRegistration(boolean enabled) - Specified by:
setAllowClientRegistrationin interfaceIRegistrationService
-