本文整理匯總了Java中org.oscm.string.Strings.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java Strings.isEmpty方法的具體用法?Java Strings.isEmpty怎麽用?Java Strings.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.oscm.string.Strings
的用法示例。
在下文中一共展示了Strings.isEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getInstanceById
import org.oscm.string.Strings; //導入方法依賴的package包/類
public ServiceInstance getInstanceById(String instanceId)
throws ServiceInstanceNotFoundException {
if (Strings.isEmpty(instanceId)) {
throw new ServiceInstanceNotFoundException(
"Service instance ID not set or empty.");
}
Query query = em.createNamedQuery("ServiceInstance.getForKey");
query.setParameter("key", instanceId);
try {
final ServiceInstance instance = (ServiceInstance) query
.getSingleResult();
return instance;
} catch (NoResultException e) {
throw new ServiceInstanceNotFoundException(
"Service instance with ID '%s' not found.", instanceId);
}
}
示例2: getInstanceBySubscriptionAndOrganization
import org.oscm.string.Strings; //導入方法依賴的package包/類
public ServiceInstance getInstanceBySubscriptionAndOrganization(
String subscriptionId, String organizationId)
throws ServiceInstanceNotFoundException {
if (Strings.isEmpty(subscriptionId) || Strings.isEmpty(organizationId)) {
throw new ServiceInstanceNotFoundException(
"Subscription or organization ID not set or empty.");
}
Query query = em
.createNamedQuery("ServiceInstance.getForSubscriptionAndOrg");
query.setParameter("subscriptionId", subscriptionId);
query.setParameter("organizationId", organizationId);
try {
final ServiceInstance instance = (ServiceInstance) query
.getSingleResult();
return instance;
} catch (NoResultException e) {
throw new ServiceInstanceNotFoundException(
"Service instance for subscription '%s' and organization '%s' not found.",
subscriptionId, organizationId);
}
}
示例3: toPOUserAndSubscriptions
import org.oscm.string.Strings; //導入方法依賴的package包/類
POUserAndSubscriptions toPOUserAndSubscriptions(CreateUserModel m) throws MarketplaceRemovedException {
POUserAndSubscriptions uas = new POUserAndSubscriptions();
uas.setEmail(m.getEmail().getValue());
uas.setFirstName(m.getFirstName().getValue());
uas.setLastName(m.getLastName().getValue());
uas.setLocale(m.getLocale().getValue());
uas.setTenantId(sessionBean.getTenantID());
String sal = m.getSalutation().getValue();
if (!Strings.isEmpty(sal)) {
uas.setSalutation(Salutation.valueOf(sal));
}
uas.setUserId(m.getUserId().getValue());
return uas;
}
示例4: operationChanged
import org.oscm.string.Strings; //導入方法依賴的package包/類
public void operationChanged() {
POSubscription subscription = model.getSelectedSubscription();
String operationId = subscription.getSelectedOperationId();
if (Strings.isEmpty(operationId)) {
subscription.setSelectedOperation(null);
subscription.setSelectedOperationId(null);
subscription.setExecuteDisabled(true);
} else {
VOTechnicalServiceOperation op = findSelectedOperation(
subscription.getVOSubscription(), operationId);
OperationModel operationModel = new OperationModel();
operationModel.setOperation(op);
try {
operationModel.setParameters(
convert(op, subscription.getVOSubscription()));
} catch (SaaSApplicationException e) {
subscription.setExecuteDisabled(true);
ui.handleException(e);
}
subscription.setSelectedOperation(operationModel);
subscription.setExecuteDisabled(false);
}
}
示例5: copyCredentialsFromControllerSettings
import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
* For backwards compatibility the technology manager credentials from the
* controller configuration are applied to the instance parameters.
*
* @param settings
* @param controllerSettings
*/
public void copyCredentialsFromControllerSettings(
ProvisioningSettings settings,
HashMap<String, Setting> controllerSettings) {
Setting userKey = controllerSettings
.get(ControllerConfigurationKey.BSS_USER_KEY.name());
Setting userPwd = controllerSettings
.get(ControllerConfigurationKey.BSS_USER_PWD.name());
if (userKey != null && !Strings.isEmpty(userKey.getValue())
&& userPwd != null && !Strings.isEmpty(userPwd.getValue())) {
// override technology manager user credentials in parameters
// (for backwards compatibility)
settings.getParameters().put(InstanceParameter.BSS_USER, userKey);
settings.getParameters().put(InstanceParameter.BSS_USER_PWD,
userPwd);
}
}
示例6: getOperationServiceAdapter
import org.oscm.string.Strings; //導入方法依賴的package包/類
public static OperationServiceAdapter getOperationServiceAdapter(
TechnicalProductOperation operation, Integer wsTimeout,
String username, String password) throws IOException,
WSDLException, ParserConfigurationException {
String target = operation.getActionUrl();
if (Strings.isEmpty(target)) {
throw new SaaSSystemException(
String.format(
"Failed to retrieve service endpoint for service operation '%s', as the target is not defined.",
Long.valueOf(operation.getKey())));
}
WSPortConnector portConnector = new WSPortConnector(target, username,
password);
SupportedOperationVersions supportedVersion = getSupportedVersion(portConnector);
OperationServiceAdapter adapter = getAdapterForVersion(supportedVersion);
final Object port = portConnector.getPort(
supportedVersion.getLocalWSDL(),
supportedVersion.getServiceClass(), wsTimeout);
adapter.setOperationService(port);
return adapter;
}
示例7: toPOUserAndSubscriptions
import org.oscm.string.Strings; //導入方法依賴的package包/類
POUserAndSubscriptions toPOUserAndSubscriptions() {
POUserAndSubscriptions uas = new POUserAndSubscriptions();
uas.setAssignedRoles(getSelectedUserRoles(model.getRoles()));
uas.setEmail(model.getEmail().getValue());
uas.setFirstName(model.getFirstName().getValue());
uas.setLastName(model.getLastName().getValue());
uas.setLocale(model.getLocale().getValue());
String sal = model.getSalutation().getValue();
if (!Strings.isEmpty(sal)) {
uas.setSalutation(Salutation.valueOf(sal));
}
uas.setUserId(model.getUserId().getValue());
uas.setKey(model.getKey());
uas.setVersion(model.getVersion());
List<Subscription> allSubs = new ArrayList<>();
allSubs.addAll(model.getAllSubscriptions().values());
uas.setSubscriptions(getAllSubscriptions(allSubs));
uas.setGroupsToBeAssigned(getSelectedUserGroups(model.getUserGroups()));
uas.setTenantId(model.getTenantId());
return uas;
}
示例8: getAuthenticationForAPPAdmin
import org.oscm.string.Strings; //導入方法依賴的package包/類
public PasswordAuthentication getAuthenticationForAPPAdmin(
Map<String, Setting> proxySettings) throws ConfigurationException {
if (proxySettings == null) {
proxySettings = getAllProxyConfigurationSettings();
}
boolean isSso = isSsoMode(proxySettings);
String usernameKey = isSso ? PlatformConfigurationKey.BSS_USER_ID.name()
: PlatformConfigurationKey.BSS_USER_KEY.name();
String ws_username = proxySettings.get(usernameKey) != null
? proxySettings.get(usernameKey).getValue() : null;
String ws_password = proxySettings
.get(PlatformConfigurationKey.BSS_USER_PWD.name()) != null
? proxySettings.get(
PlatformConfigurationKey.BSS_USER_PWD.name())
.getValue()
: null;
if (Strings.isEmpty(ws_username) || ws_password == null) {
LOGGER.error(
"Request context for web service call is incomplete due to missing credentials. Please check platform settings.");
throw new ConfigurationException(
"The APP configuration settings define incomplete admin credentials. Please define values for both "
+ usernameKey + " and "
+ PlatformConfigurationKey.BSS_USER_PWD.name(),
usernameKey);
}
return new PasswordAuthentication(ws_username, ws_password);
}
示例9: getIdentifier
import org.oscm.string.Strings; //導入方法依賴的package包/類
/**
* If the instanceId is not available (creation), return the instance key.
*/
public String getIdentifier() {
if (!Strings.isEmpty(instanceId)) {
return instanceId;
}
return Long.valueOf(tkey).toString();
}
示例10: getLabel
import org.oscm.string.Strings; //導入方法依賴的package包/類
String getLabel(VOMarketplace vMp) {
if (vMp == null) {
return "";
}
if (vMp.getName() == null || Strings.isEmpty(vMp.getName())) {
return vMp.getMarketplaceId();
}
return String.format("%s (%s)", vMp.getName(), vMp.getMarketplaceId());
}
示例11: isAPPSuspend
import org.oscm.string.Strings; //導入方法依賴的package包/類
public boolean isAPPSuspend() {
String isSuspend = "";
try {
isSuspend = getProxyConfigurationSetting(
PlatformConfigurationKey.APP_SUSPEND);
} catch (ConfigurationException exception) {
// this exception should not happen due to no decryption needed for
// APP_SUSPEND, no handle needed
}
if (!Strings.isEmpty(isSuspend)) {
return Boolean.valueOf(isSuspend).booleanValue();
}
return false;
}
示例12: isDeleteDisabled
import org.oscm.string.Strings; //導入方法依賴的package包/類
public boolean isDeleteDisabled() {
ManageUsersModel m = getModel();
boolean result = Strings.isEmpty(m.getSelectedUserId())
|| Strings.areStringsEqual(ui.getMyUserId(),
m.getSelectedUserId());
return result;
}
示例13: orgChanged
import org.oscm.string.Strings; //導入方法依賴的package包/類
public void orgChanged(ValueChangeEvent event)
throws SaaSApplicationException {
final String orgId = (String) event.getNewValue();
final String oldId = model.getOrganizationIdentifier();
model.setOrganizationIdentifier(orgId);
if (Strings.isEmpty(orgId)) {
model.getSettings().clear();
model.setFile(null);
model.setShowIsPlatformSettingColumnVisible(false);
model.setShowClearButtonVisible(true);
initPlatformSettings();
} else if (!orgId.equals(oldId)) {
initSettingData();
}
}
示例14: getAuthenticationForBESTechnologyManager
import org.oscm.string.Strings; //導入方法依賴的package包/類
public PasswordAuthentication getAuthenticationForBESTechnologyManager(
String controllerId, ServiceInstance serviceInstance,
Map<String, Setting> proxySettings) throws ConfigurationException {
if (proxySettings == null) {
proxySettings = getAllProxyConfigurationSettings();
}
boolean isSso = isSsoMode(proxySettings);
if (serviceInstance != null) {
controllerId = serviceInstance.getControllerId();
}
HashMap<String, Setting> controllerSettings = getControllerConfigurationSettings(
controllerId);
String usernameKey = isSso
? ControllerConfigurationKey.BSS_USER_ID.name()
: ControllerConfigurationKey.BSS_USER_KEY.name();
Setting user = controllerSettings.get(usernameKey);
Setting userPwd = controllerSettings
.get(ControllerConfigurationKey.BSS_USER_PWD.name());
if (user == null || Strings.isEmpty(user.getValue()) || userPwd == null
|| Strings.isEmpty(userPwd.getValue())) {
LOGGER.warn(
"The controller settings for controller '{}' define incomplete technology manager credentials. Please define values for both {} and {}.",
new String[] { controllerId, usernameKey,
ControllerConfigurationKey.BSS_USER_PWD.name() });
}
String ws_username = null;
String ws_password = null;
if (user != null && !Strings.isEmpty(user.getValue()) && userPwd != null
&& !Strings.isEmpty(userPwd.getValue())) {
ws_username = user.getValue();
ws_password = userPwd.getValue();
} else {
if (serviceInstance != null) {
InstanceParameter userParam = serviceInstance
.getParameterForKey(InstanceParameter.BSS_USER);
InstanceParameter userPwdParam = serviceInstance
.getParameterForKey(InstanceParameter.BSS_USER_PWD);
try {
ws_username = userParam == null ? null
: userParam.getDecryptedValue();
ws_password = userPwdParam == null ? null
: userPwdParam.getDecryptedValue();
} catch (BadResultException e) {
throw new ConfigurationException(e.getMessage(),
InstanceParameter.BSS_USER_PWD);
}
}
if (Strings.isEmpty(ws_username) || ws_password == null) {
LOGGER.error(
"Request context for web service call is incomplete due to missing credentials. Please check controller settings [{}].",
new String[] { controllerId });
throw new ConfigurationException(
"The controller settings for controller '"
+ controllerId
+ "' are missing complete technology manager credentials. Please define values for both "
+ usernameKey + " and "
+ ControllerConfigurationKey.BSS_USER_PWD
.name(),
usernameKey);
}
}
return new PasswordAuthentication(ws_username, ws_password);
}
示例15: isSupportedVersion
import org.oscm.string.Strings; //導入方法依賴的package包/類
boolean isSupportedVersion(String version) {
if (Strings.isEmpty(version) || SupportedVersions.contains(version)) {
return true;
}
return false;
}