Package org.serviceconnector.cmd.sc
Class CommandAdapter
java.lang.Object
org.serviceconnector.cmd.sc.CommandAdapter
- All Implemented Interfaces:
ICommand
- Direct Known Subclasses:
AttachCommand,CheckRegistrationCommand,ClnChangeSubscriptionCommand,ClnCreateSessionCommand,ClnDeleteSessionCommand,ClnExecuteCommand,ClnSubscribeCommand,ClnUnsubscribeCommand,CscAbortSubscriptionCommand,CscChangeSubscriptionCommand,CscCreateSessionCommand,CscDeleteSessionCommand,CscExecuteCommand,CscSubscribeCommand,CscUnsubscribeCommand,DeRegisterServerCommand,DetachCommand,EchoCommand,FileDownloadCommand,FileListCommand,FileUploadCommand,InspectCommand,ManageCommand,PublishCommand,ReceivePublicationCommand,RegisterServerCommand
The Class CommandAdapter. Adapter for every kind of command. Provides basic functions that is used by executions of commands.
- Author:
- JTraber
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BasicConfigurationThe basic conf.protected ServerRegistryThe server registry.protected ServiceRegistryThe service registry.protected SessionRegistryThe session registry.protected SubscriptionRegistryThe subscription registry. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SCMPMsgTypegetKey()Gets the key.protected PublishMessageQueue<SCMPMessage>getPublishMessageQueueById(Subscription subscription) Gets the publish message queue by id.protected ServicegetService(String serviceName) Gets the service.protected SessiongetSessionById(String sessionId) Gets the session by id.protected StatefulServicegetStatefulService(String serviceName) Gets the stateful service.protected SubscriptiongetSubscriptionById(String subscriptionId) Gets the subscription by id.booleanChecks if command passes through message parts.voidresetServerTimeout(String serviceName, InetSocketAddress socketAddress) Reset server timeout.voidValidate request.protected FileServicevalidateFileService(String serviceName) Validate file service.protected PublishServicevalidatePublishService(String serviceName) Validate publish service.protected PublishServicevalidatePublishService(Service service) Validate publish service.
-
Field Details
-
sessionRegistry
The session registry. -
subscriptionRegistry
The subscription registry. -
serverRegistry
The server registry. -
serviceRegistry
The service registry. -
basicConf
The basic conf.
-
-
Constructor Details
-
CommandAdapter
public CommandAdapter()
-
-
Method Details
-
getSessionById
Gets the session by id. Checks properness of session, if session is null given session id is wrong - no session found.- Parameters:
sessionId- the session id- Returns:
- the session by id
- Throws:
SCMPCommandException- session is not in registry, invalid session id
-
getSubscriptionById
Gets the subscription by id.- Parameters:
subscriptionId- the subscription id- Returns:
- the subscription by id
- Throws:
SCMPCommandException- the sCMP command exception
-
getPublishMessageQueueById
protected PublishMessageQueue<SCMPMessage> getPublishMessageQueueById(Subscription subscription) throws Exception Gets the publish message queue by id.- Parameters:
subscription- the subscription- Returns:
- the publish message queue by id
- Throws:
Exception- the exception
-
getService
Gets the service.- Parameters:
serviceName- the service name- Returns:
- the service
- Throws:
SCMPCommandException- the SCMP command exception
-
validatePublishService
Validate publish service.- Parameters:
serviceName- the service name- Returns:
- the publish service
- Throws:
SCMPCommandException- the SCMP command exception
-
validatePublishService
Validate publish service.- Parameters:
service- the service- Returns:
- the publish service
- Throws:
SCMPCommandException- the SCMP command exception
-
validateFileService
Validate file service.- Parameters:
serviceName- the service name- Returns:
- the publish service
- Throws:
SCMPCommandException- the SCMP command exception
-
getStatefulService
Gets the stateful service. This method does not control the state of the service.- Parameters:
serviceName- the service name- Returns:
- the stateful service
- Throws:
SCMPCommandException- the SCMP command exception
-
resetServerTimeout
Reset server timeout. Gets server from the registry and refreshes server timeouts.- Parameters:
serviceName- the service namesocketAddress- the socket address
-
validate
Validate request. -
isPassThroughPartMsg
public boolean isPassThroughPartMsg()Checks if command passes through message parts.- Specified by:
isPassThroughPartMsgin interfaceICommand- Returns:
- true, if is pass through part msg
-
getKey
Gets the key.
-