Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 87 → Rev 86

/xservices/trunk/src/java/net/brutex/xservices/ws/impl/StringServiceImpl.java
15,6 → 15,8
*/
package net.brutex.xservices.ws.impl;
 
 
 
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
33,31 → 35,27
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES, endpointInterface = "net.brutex.xservices.ws.StringService", serviceName = StringService.SERVICE_NAME)
public class StringServiceImpl implements StringService {
 
public StringReplaceType replaceRegEx(String res, String search,
String replace, String flags) throws XServicesFault {
try {
int allflags = 0;
if (flags.contains("i")) {
allflags = allflags + Pattern.CASE_INSENSITIVE;
}
Pattern pattern = Pattern.compile(search, allflags);
Matcher matcher = pattern.matcher(res);
int count = 0;
while (matcher.find()) {
count++;
}
if (flags.contains("g")) {
return new StringReplaceType(matcher.replaceAll(replace), count);
} else {
if (count > 1)
count = 1;
return new StringReplaceType(matcher.replaceFirst(replace),
count);
}
} catch (Exception e) {
throw new XServicesFault(e);
public StringReplaceType replaceRegEx(String res, String search, String replace,
String flags) throws XServicesFault {
int allflags = 0;
if(flags.contains("i")) {
allflags = allflags + Pattern.CASE_INSENSITIVE;
}
 
Pattern pattern = Pattern.compile(search, allflags);
Matcher matcher = pattern.matcher(res);
int count = 0;
while( matcher.find()) {
count++;
}
if(flags.contains("g")) {
return new StringReplaceType(matcher.replaceAll(replace), count);
} else {
if(count>1) count = 1;
return new StringReplaceType(matcher.replaceFirst(replace), count);
}
}
 
}
/xservices/trunk/src/java/net/brutex/xservices/ws/impl/MiscServiceImpl.java
25,7 → 25,6
import net.brutex.xservices.types.HostinfoType;
import net.brutex.xservices.types.MailMimeType;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.types.RuntimeInfoType;
import net.brutex.xservices.types.ant.FileSetResource;
import net.brutex.xservices.util.BrutexNamespaces;
import net.brutex.xservices.util.RunTask;
156,8 → 155,4
sleep.setMilliseconds(milliseconds);
return runner.postTask();
}
 
public RuntimeInfoType getMemory() {
return new RuntimeInfoType();
}
}
/xservices/trunk/src/java/net/brutex/xservices/ws/impl/StorageServiceImpl.java
34,13 → 34,11
 
public String storeText(String text) throws XServicesFault {
// TODO Auto-generated method stub
System.err.println("storeText is not yet implemented");
return null;
}
 
public String storeBinary(AttachmentType binary) throws XServicesFault {
// TODO Auto-generated method stub
System.err.println("storeBinary is not yet implemented");
return null;
}
 
52,7 → 50,7
public void deliverCollection(CollectionType collection,
TargetNodeType targetnode, boolean isFiring) throws XServicesFault {
// TODO Auto-generated method stub
System.err.println("deliverCollection is not yet implemented");
}
}
/xservices/trunk/src/java/net/brutex/xservices/ws/impl/JobServiceImpl.java
1,5 → 1,5
/*
* Copyright 2012 Brian Rosenberger (Brutex Network)
* Copyright 2011 Brian Rosenberger (Brutex Network)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
15,6 → 15,7
*/
package net.brutex.xservices.ws.impl;
 
import static org.quartz.TriggerBuilder.newTrigger;
 
import java.util.ArrayList;
import java.util.GregorianCalendar;
36,9 → 37,8
import org.quartz.TriggerKey;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.matchers.GroupMatcher;
import static org.quartz.TriggerBuilder.*;
 
import net.brutex.xservices.types.ScheduledJob;
import net.brutex.xservices.types.SchedulerStatisticsType;
import net.brutex.xservices.util.BrutexNamespaces;
import net.brutex.xservices.util.JobWrapper;
import net.brutex.xservices.ws.JobService;
148,14 → 148,4
}
}
 
 
public SchedulerStatisticsType getStatistics() throws XServicesFault {
try {
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
return new SchedulerStatisticsType(scheduler);
} catch (SchedulerException e) {
throw new XServicesFault(e);
}
}
 
}