本文整理汇总了Java中org.apache.cxf.common.util.StringUtils.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isEmpty方法的具体用法?Java StringUtils.isEmpty怎么用?Java StringUtils.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.common.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeSDKSession
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
@Override
public synchronized void removeSDKSession(String sdkSession)
{
if (StringUtils.isEmpty(sdkSession))
{
return;
}
try
{
if (!sessionMap.containsKey(sdkSession))
return;
sessionMap.remove(sdkSession);
}
catch (Exception e)
{
LOGGER.error("", e);
}
}
示例2: loginUser
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
@Override
public ApiResponse<UserSession> loginUser( LoginCredentials login ) {
if( login == null ) {
return new ApiResponse<>( ApiResponse.FAILURE, "login data is required", null );
}
if( StringUtils.isEmpty( login.getLogin() ) ) { // TODO: add unit tests
return new ApiResponse<>( ApiResponse.FAILURE, "username or email is required", null );
}
if( StringUtils.isEmpty( login.getPassword() ) ) { // TODO: add unit tests
return new ApiResponse<>( ApiResponse.FAILURE, "password is required", null );
}
// BaseResponse<UserSession> authResp = userManager.authenticateUser( login );
ValueResponse<UserSession> authResp = new ValueResponse( 1, "moo!", new UserSession() );
return new ApiResponse<>( authResp.getResultCode(), authResp.getMessage(), authResp.getValue() );
}
示例3: isDeclared
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
private static boolean isDeclared(Element e, String namespaceURI, String prefix) {
while (e != null) {
Attr att;
if (prefix != null && prefix.length() > 0) {
att = e.getAttributeNodeNS(XML_NS, prefix);
} else {
att = e.getAttributeNode("xmlns");
}
if (att != null && att.getNodeValue().equals(namespaceURI)) {
return true;
}
if (e.getParentNode() instanceof Element) {
e = (Element)e.getParentNode();
} else if (StringUtils.isEmpty(prefix) && StringUtils.isEmpty(namespaceURI)) {
//A document that probably doesn't have any namespace qualifies elements
return true;
} else {
e = null;
}
}
return false;
}
示例4: validateItemTypeName
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
private boolean validateItemTypeName(EdoItemTypeBo edoItemType) {
String itemId = EdoServiceLocator.getEdoItemTypeService().getItemTypeId(edoItemType.getItemTypeName(), edoItemType.getEffectiveLocalDate());
if (!StringUtils.isEmpty(itemId)) {
if (StringUtils.isEmpty(edoItemType.getEdoItemTypeId())) { // New or Copy
// error.itemtype.exist = Item Type '{0}' already exists.
this.putFieldError("dataObject.edoItemType", "error.itemtype.exist", edoItemType.getItemTypeName());
return false;
} else {
if (!itemId.equals(edoItemType.getEdoItemTypeId())) {
// error.itemtype.exist = Item Type '{0}' already exists.
this.putFieldError("dataObject.edoItemType", "error.itemtype.exist", edoItemType.getItemTypeName());
return false;
}
}
}
return true;
}
示例5: generate
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
/**
* Method inserts id for prism container values, which didn't have ids,
* also returns all container values which has generated id
*/
public IdGeneratorResult generate(@NotNull PrismObject object, @NotNull Operation operation) {
IdGeneratorResult result = new IdGeneratorResult();
boolean adding = Operation.ADD.equals(operation);
result.setGeneratedOid(adding);
if (StringUtils.isEmpty(object.getOid())) {
String oid = UUID.randomUUID().toString();
object.setOid(oid);
result.setGeneratedOid(true);
}
List<PrismContainer<?>> values = listAllPrismContainers(object);
generateContainerIds(values, result, operation);
return result;
}
示例6: getRecipientsAddresses
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
protected List<String> getRecipientsAddresses(Event event, GeneralNotifierType generalNotifierType, ExpressionVariables variables,
UserType defaultRecipient, String transportName, Transport transport, Task task, OperationResult result) {
List<String> addresses = new ArrayList<>();
if (!generalNotifierType.getRecipientExpression().isEmpty()) {
for (ExpressionType expressionType : generalNotifierType.getRecipientExpression()) {
List<String> r = evaluateExpressionChecked(expressionType, variables, "notification recipient", task, result);
if (r != null) {
addresses.addAll(r);
}
}
if (addresses.isEmpty()) {
getLogger().info("Notification for " + event + " will not be sent, because there are no known recipients.");
}
} else if (defaultRecipient == null) {
getLogger().info("Unknown default recipient, notification will not be sent.");
} else {
String address = transport.getDefaultRecipientAddress(defaultRecipient);
if (StringUtils.isEmpty(address)) {
getLogger().info("Notification to " + defaultRecipient.getName() + " will not be sent, because the user has no address (mail, phone number, etc) for transport '" + transportName + "' set.");
} else {
addresses.add(address);
}
}
return addresses;
}
示例7: validateInput
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
/**
* Validates the given request for normal processing.
*
* @param request
* @throws OleDocStoreException - if the operation is invalid
* - if no documents are specified
*/
private void validateInput(Request request) throws OleDocStoreException {
Set<String> validOperationSet = Request.validOperationSet;
if (StringUtils.isEmpty(request.getUser())) {
throw new OleDocStoreException("User cannot be null or empty. Please verify input file.");
}
if (StringUtils.isEmpty(request.getOperation())) {
throw new OleDocStoreException("Operation cannot be null or empty. Please verify input file");
} else {
//verify for valid docstore operation
if (validOperationSet.contains(request.getOperation())) {
for (RequestDocument requestDocument : request.getRequestDocuments()) {
requestDocument.setUser(request.getUser());
requestDocument.setOperation(request.getOperation());
}
} else {
throw new OleDocStoreException("Not a valid Docstore operation:" + request.getOperation());
}
}
}
示例8: validateBulkProcessInput
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
/**
* Validates the given request for bulk processing.
*
* @param request
* @throws OleDocStoreException - if the operation is invalid
* - if no documents are specified
* - if all documents are not of same [cat-type-format]
*/
private void validateBulkProcessInput(BulkProcessRequest request, List<RequestDocument> requestDocuments)
throws OleDocStoreException {
Set<String> validOperationSet = BulkProcessRequest.validOperationSet;
if (StringUtils.isEmpty(request.getUser())) {
request.setUser("BulkIngest-User");
}
if (StringUtils.isEmpty(request.getOperation().toString())) {
throw new OleDocStoreException("Operation cannot be null or empty. Please verify input file");
} else {
//verify for valid docstore operation
if (validOperationSet.contains(request.getOperation().toString())) {
for (RequestDocument requestDocument : requestDocuments) {
requestDocument.setUser(request.getUser());
requestDocument.setOperation(request.getOperation().toString());
}
} else {
throw new OleDocStoreException("Not a valid Docstore operation:" + request.getOperation());
}
}
}
示例9: getDebarredVendorUnmatchedSearchResults
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
protected List<? extends BusinessObject> getDebarredVendorUnmatchedSearchResults(Map<String, String> fieldValues) {
List<VendorDetail> vendorResultList = vendorExcludeService.getDebarredVendorsUnmatched();
List<VendorDetail> filteredVendorList = new ArrayList<VendorDetail> ();
VendorAddress defaultAddress;
String vendorType = fieldValues.get("vendorTypeCode");
for (VendorDetail vendor : vendorResultList) {
if (!StringUtils.isEmpty(vendorType) && !vendor.getVendorHeader().getVendorTypeCode().equals(vendorType)) {
continue;
}
defaultAddress = vendorService.getVendorDefaultAddress(vendor.getVendorAddresses(), vendor.getVendorHeader().getVendorType().getAddressType().getVendorAddressTypeCode(), "");
if (defaultAddress != null ) {
vendor.setDefaultAddressLine1(defaultAddress.getVendorLine1Address());
vendor.setDefaultAddressCity(defaultAddress.getVendorCityName());
vendor.setDefaultAddressStateCode(defaultAddress.getVendorStateCode());
vendor.setDefaultAddressCountryCode(defaultAddress.getVendorCountryCode());
}
filteredVendorList.add(vendor);
}
return filteredVendorList;
}
示例10: compare
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
@Override
public int compare(final AttrTO left, final AttrTO right) {
if (left == null || StringUtils.isEmpty(left.getSchema())) {
return -1;
}
if (right == null || StringUtils.isEmpty(right.getSchema())) {
return 1;
} else if (AbstractAttrs.this.reoderSchemas()) {
int leftIndex = AbstractAttrs.this.whichAttrs.indexOf(left.getSchema());
int rightIndex = AbstractAttrs.this.whichAttrs.indexOf(right.getSchema());
if (leftIndex > rightIndex) {
return 1;
} else if (leftIndex < rightIndex) {
return -1;
} else {
return 0;
}
} else {
return left.getSchema().compareTo(right.getSchema());
}
}
示例11: validateLeavePlan
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
boolean validateLeavePlan(EmployeeOverride eo) {
if(StringUtils.isEmpty(eo.getLeavePlan())) {
this.putFieldError("leavePlan", "error.employeeOverride.leavePlan.notfound");
return false;
} else if(eo.getEffectiveDate() != null) {
AccrualCategoryContract ac = HrServiceLocator.getAccrualCategoryService().
getAccrualCategory(eo.getAccrualCategory(), eo.getEffectiveLocalDate());
PrincipalHRAttributes pha = HrServiceLocator.getPrincipalHRAttributeService().
getPrincipalCalendar(eo.getPrincipalId(), eo.getEffectiveLocalDate());
if(ac != null && pha != null && !ac.getLeavePlan().equals(pha.getLeavePlan())) {
this.putFieldError("leavePlan", "error.employeeOverride.leavePlan.inconsistent", eo.getAccrualCategory() );
return false;
}
}
return true;
}
示例12: authenticate
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
@Override
public Pair<Boolean, ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Trying SAML2 auth for user: " + username);
}
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
s_logger.debug("Username or Password cannot be empty");
return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
}
final UserAccount userAccount = _userAccountDao.getUserAccount(username, domainId);
if (userAccount == null || userAccount.getSource() != User.Source.SAML2) {
s_logger.debug("Unable to find user with " + username + " in domain " + domainId + ", or user source is not SAML2");
return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
} else {
User user = _userDao.getUser(userAccount.getId());
if (user != null && user.getSource() == User.Source.SAML2 && user.getExternalEntity() != null) {
return new Pair<Boolean, ActionOnFailedAuthentication>(true, null);
}
}
// Deny all by default
return new Pair<Boolean, ActionOnFailedAuthentication>(false, ActionOnFailedAuthentication.INCREMENT_INCORRECT_LOGIN_ATTEMPT_COUNT);
}
示例13: handleMessage
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
String mappedNamespace = message.getExchange().getService().getName().getNamespaceURI();
InputStream in = message.getContent(InputStream.class);
if( in != null )
{
// ripped from StaxInInterceptor
String contentType = (String) message.get(Message.CONTENT_TYPE);
if( contentType == null )
{
// if contentType is null, this is likely a an empty
// post/put/delete/similar, lets see if it's
// detectable at all
Map<String, List<String>> m = CastUtils.cast((Map<?, ?>) message.get(Message.PROTOCOL_HEADERS));
if( m != null )
{
List<String> contentLen = HttpHeaderHelper.getHeader(m, HttpHeaderHelper.CONTENT_LENGTH);
List<String> contentTE = HttpHeaderHelper.getHeader(m, HttpHeaderHelper.CONTENT_TRANSFER_ENCODING);
if( (StringUtils.isEmpty(contentLen) || "0".equals(contentLen.get(0)))
&& StringUtils.isEmpty(contentTE) )
{
return;
}
}
}
// Inject our LegacyPythonHack
XMLStreamReader reader = StaxUtils.createXMLStreamReader(in);
message.setContent(XMLStreamReader.class, new LegacyPythonClientXMLStreamReader(reader, mappedNamespace));
}
}
示例14: getRequestURL
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
private URL getRequestURL(DestinationConfiguration destinationConfiguration, String path) throws IOException {
String requestBaseURLString = destinationConfiguration.getProperty(DESTINATION_URL);
if (StringUtils.isEmpty(requestBaseURLString)) {
String errorMessage = MessageFormat.format(ERROR_NOT_CONFIGURED_DESTINATION_URL, destinationName);
LOGGER.error(errorMessage);
throw new IOException(errorMessage);
}
if (!requestBaseURLString.endsWith(PATH_SUFFIX)) {
requestBaseURLString += PATH_SUFFIX;
}
LOGGER.info(INFO_DESTINATION_REQUEST, destinationName, requestBaseURLString, path);
URL baseURL = new URL(requestBaseURLString);
return new URL(baseURL, path);
}
示例15: validateContentType
import org.apache.cxf.common.util.StringUtils; //导入方法依赖的package包/类
private void validateContentType(SimpleHttpResponse httpResponse) throws InvalidResponseException {
String requestPath = httpResponse.getRequestPath();
String responseContentType = httpResponse.getContentType();
if (StringUtils.isEmpty(responseContentType)) {
throw new InvalidResponseException(MessageFormat.format(ERROR_NOT_FOUND_CONTENT_TYPE, requestPath));
}
if (!responseContentType.contains(MediaType.APPLICATION_JSON)) {
throw new InvalidResponseException(MessageFormat.format(ERROR_INVALID_CONTENT_TYPE, responseContentType, requestPath));
}
}