Exemplo n.º 1
0
	def __create__(self, update):
		params = self.__collectattrs__()
		logging.info( "Configuring SIBusMember with attributes %s" % params )
		if update:
			AdminTask.modifySIBusMember(params)
		else:
			AdminTask.addSIBusMember(params)
Exemplo n.º 2
0
	def __create__(self, update):
		params = self.__collectattrs__()
		logging.info("Configuring J2CActivationSpec under %s scope with attributes '%s'" % (self.scope.split('#')[1].split('_')[0], params))
		if update:
			AdminTask.modifySIBJMSActivationSpec(self.__was_cfg_parent__, params)
		else:
			AdminTask.createSIBJMSActivationSpec(self.__was_cfg_parent__, params)
Exemplo n.º 3
0
	def __create__(self, update):    
		params = self.__collectattrs__()
		logging.info("Configuring SIBus with attributes %s" % params)
		if update:
			AdminTask.modifySIBus(params)
		else:
			AdminTask.createSIBus(params)
        
		for busMember in self.__busmembers:
			busMember.__create__(update)
Exemplo n.º 4
0
    def getAdminhostPort(self):
        srv = map(getServerName, self.getAdminServers())[0]
        adm = filter(isAdminHost, AdminTask.listServerPorts(srv).splitlines())
        port = map(getPort, adm)[0]

        logging.debug("Admin host port (port range start) is %i" % port)
        return port
Exemplo n.º 5
0
 def getAdminhostPort(self): 
     srv  = map(getServerName, self.getAdminServers())[0]
     adm  = filter(isAdminHost, AdminTask.listServerPorts(srv).splitlines())
     port = map(getPort, adm)[0]
     
     logging.debug("Admin host port (port range start) is %i" % port)
     return port
Exemplo n.º 6
0
def modifyServerPort(serverName, nodeName, endPointName, newPort):
    print 'About to change server %s endpoint %s to new Port %s' % (
        serverName, endPointName, newPort)
    opts = '[-nodeName %s -endPointName %s -host * -port %s -modifyShared true]' % (
        nodeName, endPointName, newPort)
    AdminTask.modifyServerPort(serverName, opts)
Exemplo n.º 7
0
	def removeAll(self):
		for id in AdminConfig.list('J2CActivationSpec').splitlines():
			logging.info('Deleting J2CActivationSpec %s' % id.split('(')[0])
			AdminTask.deleteSIBJMSActivationSpec(id)
Exemplo n.º 8
0
	def removeAll(self):
		for id in AdminTask.listSIBJMSQueues(self.__was_cfg_parent__).splitlines():
			logging.info("Deleting SIBJMSQueue %s" % id.split('(')[0])
			AdminTask.deleteSIBJMSQueue(id)
Exemplo n.º 9
0
	def __create__(self, update):
		params = self.__collectattrs__()
		if update:
			AdminTask.modifySIBDesination(params)
		else:
			AdminTask.createSIBDestination(params)
Exemplo n.º 10
0
	def removeAll(self):
		args  = '[ -type %s]' % self.type
		for id in AdminTask.listSIBJMSConnectionFactories(self.__was_cfg_parent__, args).splitlines():
			logging.info("Deleting SIBJMSConnectionFactory %s" % id.split('(')[0]))
			AdminTask.deleteSIBJMSConnectionFactory(id)
Exemplo n.º 11
0
		self.name     = name
		self.jndiName = jndiName
		self.parent   = parent
		
	def __create__(self, update):
		if self.queueName is None:
			self.queueName = '_SYSTEM.Exception.Destination.%s.%s-%s' % (
					Node().getName(), 
					getServerName(self.parent.getAdminServers()[0]), 
					self.busName
			)
		
		params = self.__collectattrs__()
		logging.info("Configuring SIBJMSQueue under %s scope with attributes '%s'" % (self.scope.split('#')[1].split('_')[0], params))
		if update:
			AdminTask.modifySIBJMSQueue(self.__was_cfg_parent__, params)
		else:
			AdminTask.createSIBJMSQueue(self.__was_cfg_parent__, params)
		
	def assignDestinationToManagedServerOrCluster(self, serverOrCluster):
		cell = self.parent
		
		if cell.isClustered():
			clusterName = cell.getCluster(serverOrCluster).getName()
			if not clusterName is None:
				self.cluster = clusterName
		else:
			managedServerId = cell.getManagedServers()[0]
			self.server     = getServerName(managedServerId)
			self.node       = getNodeName(managedServerId)
	
Exemplo n.º 12
0
def modifyServerPort(serverName, nodeName, endPointName, newPort):
    print 'About to change server %s endpoint %s to new Port %s' % (serverName, endPointName, newPort)
    opts = '[-nodeName %s -endPointName %s -host * -port %s -modifyShared true]' % (nodeName, endPointName, newPort)
    AdminTask.modifyServerPort(serverName, opts)
Exemplo n.º 13
0
	
	def __getconfigid__(self, id = None):
		return self.__wasid
	
	def __remove__(self, deep):
		raise NotImplementedError, "%s.remove* method disabled for security reasons." % self.__was_cfg_type__

#
# Security utilities
#

def installSignerCertificateInKeyStore(certFileName, keyStoreName):
	"""Installs a certificate file into the WebSphere's key store"""
    certFileLocation = certFileName
	logging.info('Preparing installation of certificate %s from file %s into store %s' % (certFileName, certFileLocation, keyStoreName))
    AdminTask.addSignerCertificate(['-keyStoreName', keyStoreName, '-certificateAlias', 
		'customcert_' + certFileName, '-certificateFilePath', certFileLocation, '-base64Encoded', 'true'])
	logging.info('certificate %s is installed in keystore %s' % (certFileName, keyStoreName))

def deleteCustomSignerCertificatesFromKeyStore(keyStoreName):
	"""Removes the custom certificates installed into the WebSphere's key store"""
	logging.info('Preparing removal of custom certificates from store %s' % (keyStoreName))

    certificateList = AdminTask.listSignerCertificates(['-keyStoreName', keyStoreName]).splitlines()
    for certificate in certificateList:
        certAlias = certificate.split('] [alias')[1].split('] [validity')[0]
        if (certAlias.find('customcert_') != -1):
            AdminTask.deleteSignerCertificate(['-keyStoreName', keyStoreName, '-certificateAlias', certAlias])
			logging.info('Certificate %s has been deleted' % (certAlias))
        else:
			logging.info('Certificate %s will not be deleted' % (certAlias))